DirListView.cpp
资源名称:FTP总集.rar [点击查看]
上传用户:tjfeida
上传日期:2013-03-10
资源大小:1917k
文件大小:20k
源码类别:
Ftp客户端
开发平台:
Visual C++
- // DirListView.cpp : implementation file
- //
- /*********************************************
- **该文件是属于WolfFTP工程中的。如果有什么问题
- **请联系
- ** tablejiang@21cn.com
- **或者访问
- ** http://wolfftp.51.net
- **以得到最新的支持。
- *********************************************/
- #include "stdafx.h"
- #include "DirListView.h"
- #include "commctrl.h"
- #include "FtpDirList.h"
- #include "shlwapi.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CDirListView
- IMPLEMENT_DYNCREATE(CDirListView, CView)
- CDirListView::CDirListView()
- {
- //init data .
- m_bDragging = false ;
- m_pDragImage = NULL ;
- }
- CDirListView::~CDirListView()
- {
- if(m_pDragImage)
- delete m_pDragImage;
- }
- BEGIN_MESSAGE_MAP(CDirListView, CView)
- //{{AFX_MSG_MAP(CDirListView)
- ON_WM_SIZE()
- ON_WM_MOUSEMOVE()
- ON_WM_LBUTTONUP()
- ON_WM_CREATE()
- ON_COMMAND(IDR_LOCAL_DELETE, OnLocalDelete)
- ON_COMMAND(IDR_LOCAL_DOWNLOAD, OnLocalDownload)
- ON_COMMAND(IDR_LOCAL_REFRESH, OnLocalRefresh)
- ON_COMMAND(IDR_LOCAL_UPLOAD, OnLocalUpload)
- ON_WM_RBUTTONDOWN()
- ON_COMMAND(ID_SELECT_ALL, OnSelectAll)
- //}}AFX_MSG_MAP
- ON_NOTIFY (LVN_BEGINDRAG, IDC_LISTCTRL1 , OnBeginDrag)
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CDirListView drawing
- void CDirListView::OnDraw(CDC* pDC)
- {
- CQuickFTPDoc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
- // TODO: add draw code here
- }
- /////////////////////////////////////////////////////////////////////////////
- // CDirListView diagnostics
- #ifdef _DEBUG
- void CDirListView::AssertValid() const
- {
- CView::AssertValid();
- }
- void CDirListView::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
- #endif //_DEBUG
- CQuickFTPDoc* CDirListView::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CQuickFTPDoc)));
- return (CQuickFTPDoc*)m_pDocument;
- }
- /////////////////////////////////////////////////////////////////////////////
- // CDirListView message handlers
- void CDirListView::OnInitialUpdate()
- {
- CView::OnInitialUpdate();
- // TODO: Add your specialized code here and/or call the base class
- }
- void CDirListView::OnSize(UINT nType, int cx, int cy)
- {
- CView::OnSize(nType, cx, cy);
- // TODO: Add your message handler code here
- //when the window size change ,we must change the
- //sub item pos and size too.
- RECT rect ;
- if( m_Combo.m_hWnd != NULL )
- {
- GetClientRect( &rect ) ;
- rect.right -= 26 ;
- rect.bottom = 150 ;
- m_Combo.MoveWindow( &rect , TRUE ) ;
- }
- if( m_ListCtrl.m_hWnd != NULL )
- {
- GetClientRect( &rect ) ;
- rect.top += 23 ;
- m_ListCtrl.MoveWindow( &rect , TRUE ) ;
- }
- GetClientRect( &rect ) ;
- rect.left = rect.right - 26;
- rect.bottom = rect.top + 20 ;
- m_UpButton.MoveWindow( &rect , TRUE ) ;
- m_UpButton.SizeToContent( ) ;
- }
- LRESULT CDirListView::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
- {
- // TODO: Add your specialized code here and/or call the base class
- switch( message )
- {
- case WM_COMMAND :
- //control message .
- HandleCommand( (int)(LOWORD( wParam )) , (HWND)lParam , (UINT)(HIWORD(wParam)) ) ;
- break ;
- case LIST_CUR_DIR_CHANGED_MSG:
- {
- //this message is change the current directory .
- CQuickFTPDoc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
- if( pDoc== NULL)
- break ;
- strcpy( pDoc->m_szLocalPath , (LPCTSTR)m_ListCtrl.GetNowListPath() ) ;
- m_Combo.SetDisplayStr( m_ListCtrl.GetNowListPath() ) ;
- }
- break ;
- case REFRESH_WND_MSG :
- {
- //this message is want refresh current window .
- m_ListCtrl.DisplayPath( m_ListCtrl.GetNowListPath() ) ;
- //m_Combo.SetDisplayStr( m_ListCtrl.GetNowListPath() ) ;
- }
- break ;
- case DIR_LIST_RCLK_MSG :
- {
- //pop the menu .
- POINT point ;
- //get mouse position .
- GetCursorPos( &point ) ;
- CMenu PopMenu ;
- PopMenu.LoadMenu( IDR_MAINFRAME ) ;
- //get sub menu
- CMenu *pPopMenu = PopMenu.GetSubMenu( 1 ) ;
- //disable some menu item .
- pPopMenu->EnableMenuItem( IDR_LOCAL_DOWNLOAD , MF_DISABLED | MF_GRAYED) ;
- //display menu
- pPopMenu->TrackPopupMenu( TPM_LEFTALIGN | TPM_RIGHTBUTTON , point.x , point.y , this ) ;
- PopMenu.DestroyMenu() ;
- }
- break ;
- default :
- break ;
- }
- return CView::DefWindowProc(message, wParam, lParam);
- }
- /****************************************************
- ** @Description
- ** This function is used for deal the control message .
- **
- ** @Parameter
- **
- **
- ** @Return:
- ** @Author: Table.JHM.太子
- ** e-mail: tablejiang@21cn.com
- ** @Date: 2001 3 26
- ****************************************************/
- void CDirListView::HandleCommand(int id, HWND hCtrlWnd, UINT uEvent)
- {
- CString strPath ;
- switch( id )
- {
- case IDC_COMBO1:
- {
- switch( uEvent )
- {
- case CBN_SELCHANGE :
- //display the changed path .
- strPath = m_Combo.GetNowPath( ) ;
- m_Combo.SetDisplayStr( strPath ) ;
- m_ListCtrl.DisplayPath( strPath ) ;
- break ;
- default :
- break ;
- }
- break ;
- }
- case IDC_BACKBUTTON :
- {
- switch( uEvent )
- {
- case BN_CLICKED:
- m_ListCtrl.UpDirectory() ;
- break ;
- default :
- break ;
- }
- }
- default:
- break ;
- }
- }
- void CDirListView::OnBeginDrag (NMHDR* pnmhdr, LRESULT* pResult)
- {
- // save the index of the item being dragged in m_nDragIndex
- m_nDragIndex = ((NM_LISTVIEW *)pnmhdr)->iItem;
- POINT pt;
- pt.x = 8;
- pt.y = 8;
- // Added 2001 3 38
- if(m_pDragImage)
- delete m_pDragImage;
- // create a drag image
- m_pDragImage = m_ListCtrl.CreateDragImage (m_nDragIndex, &pt);
- ASSERT (m_pDragImage);
- // changes the cursor to the drag image (DragMove() is still required in
- // OnMouseMove())
- VERIFY (m_pDragImage->BeginDrag ( 0 , CPoint (8, 8)));
- VERIFY (m_pDragImage->DragEnter (GetDesktopWindow (), ((NM_LISTVIEW *)pnmhdr)->ptAction));
- // set dragging flag
- m_bDragging = TRUE;
- m_hDropItem = NULL;
- m_nDropIndex = -1;
- m_pDropWnd = &m_ListCtrl ;
- // capture all mouse messages
- SetCapture ();
- }
- void CDirListView::OnMouseMove(UINT nFlags, CPoint point)
- {
- // TODO: Add your message handler code here and/or call default
- if (m_bDragging)
- {
- CPoint pt (point);
- ClientToScreen (&pt);
- // move the drag image
- VERIFY (m_pDragImage->DragMove (pt));
- // unlock window updates
- VERIFY (m_pDragImage->DragShowNolock (FALSE));
- CWnd* pDropWnd = WindowFromPoint (pt);
- // get the CWnd pointer of the window that is under the mouse cursor
- ASSERT (pDropWnd);
- // if we drag outside current window
- if (pDropWnd != m_pDropWnd)
- {
- // turn off hilight for drop target in list control
- if (m_nDropIndex != -1)
- {
- CListCtrl* pList = (CListCtrl*)m_pDropWnd;
- VERIFY (pList->SetItemState (m_nDropIndex, 0, LVIS_DROPHILITED));
- // redraw item
- VERIFY (pList->RedrawItems (m_nDropIndex, m_nDropIndex));
- pList->UpdateWindow ();
- m_nDropIndex = -1;
- }
- }
- // save current window pointer
- m_pDropWnd = pDropWnd;
- // convert from screen coordinates to drop target client coordinates
- pDropWnd->ScreenToClient (&pt);
- // if window is CListCtrl
- if (pDropWnd->IsKindOf (RUNTIME_CLASS (CListCtrl)))
- {
- UINT uFlags;
- CListCtrl* pList = (CListCtrl*)pDropWnd;
- // turn off hilight for previous drop target
- pList->SetItemState (m_nDropIndex, 0, LVIS_DROPHILITED);
- // redraw previous item
- pList->RedrawItems (m_nDropIndex, m_nDropIndex);
- // get the item that is below cursor
- m_nDropIndex = ((CListCtrl*)pDropWnd)->HitTest (pt, &uFlags);
- if( m_nDropIndex != -1 )
- {
- if( pDropWnd == &m_ListCtrl )
- {
- if( !CheckThePointPos( m_nDropIndex ) )
- DestroyCursor( ::SetCursor( LoadCursor( NULL , IDC_NO ) ) ) ;
- else
- DestroyCursor( ::SetCursor( LoadCursor( NULL , IDC_ARROW ) ) ) ;
- // highlight it
- pList->SetItemState (m_nDropIndex, LVIS_DROPHILITED, LVIS_DROPHILITED);
- // redraw item
- pList->RedrawItems (m_nDropIndex, m_nDropIndex);
- }
- else
- {
- DestroyCursor( ::SetCursor( LoadCursor( NULL , IDC_ARROW ) ) ) ;
- }
- //update the change.
- pList->UpdateWindow ();
- }
- else
- {
- //is in list?
- if( pDropWnd != &m_ListCtrl )
- {
- DestroyCursor( ::SetCursor( LoadCursor( NULL , IDC_ARROW ) ) ) ;
- }
- else
- DestroyCursor( ::SetCursor( LoadCursor( NULL , IDC_NO ) ) ) ;
- }
- }
- else
- {
- // is in Genius dlg ?
- if( pDropWnd->m_hWnd == m_ListInfo.hGenius )
- {
- DestroyCursor( ::SetCursor( LoadCursor( NULL , IDC_ARROW ) ) ) ;
- }
- else
- {
- DestroyCursor( ::SetCursor( LoadCursor( NULL , IDC_NO ) ) ) ;
- }
- }
- // lock window updates
- VERIFY (m_pDragImage->DragShowNolock (TRUE));
- }
- CView::OnMouseMove(nFlags, point);
- }
- void CDirListView::OnLButtonUp(UINT nFlags, CPoint point)
- {
- // TODO: Add your message handler code here and/or call default
- if (m_bDragging)
- {
- // release mouse capture
- VERIFY (::ReleaseCapture ());
- m_bDragging = FALSE;
- // end dragging
- VERIFY (m_pDragImage->DragLeave (GetDesktopWindow ()));
- m_pDragImage->EndDrag ();
- CPoint pt (point);
- ClientToScreen (&pt);
- // get the CWnd pointer of the window that is under the mouse cursor
- CWnd* pDropWnd = WindowFromPoint (pt);
- ASSERT (pDropWnd);
- // if window is CListCtrl
- if (pDropWnd->IsKindOf ( RUNTIME_CLASS ( CListCtrl ) ) )
- {
- //is back job listctrl?
- if( pDropWnd->m_hWnd != m_ListInfo.hBkJobList )
- {
- CListCtrl* pListWnd = ( CListCtrl*)pDropWnd ;
- pListWnd->SetItemState (m_nDropIndex, 0, LVIS_DROPHILITED);
- pListWnd->RedrawItems (m_nDropIndex, m_nDropIndex);
- //up load .
- DropItemOnList( (CListCtrl*)pDropWnd );
- }
- else
- {
- //add item to background transmit queue .
- AddSelectItemToBkTransmitQueue( ) ;
- }
- }
- else
- { //is in genius dlg ?
- if( pDropWnd->m_hWnd == m_ListInfo.hGenius )
- {
- ::PostMessage( m_ListInfo.hGenius , GENIUS_WND_SPLIT_MSG , 0 , 0 ) ;
- AddSelectItemToBkTransmitQueue( ) ;
- }
- }
- }
- CView::OnLButtonUp(nFlags, point);
- }
- /****************************************************
- ** @Description
- ** The drop on listctrl .
- **
- ** @Parameter
- ** CListCtrl* pDropWnd :the drop destination .
- **
- ** @Return: success return true ,else return false
- ** @Author: Table.JHM.太子
- ** e-mail: tablejiang@21cn.com
- ** @Date: 2001 3 26
- ****************************************************/
- BOOL CDirListView::DropItemOnList(CListCtrl *pDropWnd)
- {
- //is in own listctrl?
- if( pDropWnd != &m_ListCtrl )
- {
- //if not , upload the select item .
- if( m_pFtp->IsConnect () )
- UploadSelectItem( NULL ) ;
- }
- else
- {
- //if yes .move the specify files .
- CDirListCtrl* pList = (CDirListCtrl*)pDropWnd ;
- if( CheckThePointPos( m_nDropIndex ) )
- {
- //the destination is a file or directory ?
- LVITEM lci ;
- char szText[MAX_PATH] ;
- char szPath[MAX_PATH] ;
- szText[0] = 0 ;
- memset( &lci , 0 , sizeof( LVITEM ) ) ;
- lci.mask = LVIF_TEXT | LVIF_STATE ;
- lci.pszText = szText ;
- lci.cchTextMax = MAX_PATH ;
- lci.iItem = m_nDropIndex ;
- lci.iSubItem = 0 ;
- lci.stateMask = LVIS_SELECTED ;
- //get select item ,and make it to full path .
- if( !m_ListCtrl.GetItem( &lci ) )
- return false ;
- strcpy( szPath , m_ListCtrl.GetNowListPath() ) ;
- strcat( szPath , lci.pszText ) ;
- //move item .
- pList->MoveSelectFile( szPath ) ;
- }
- }
- return true ;
- }
- /****************************************************
- ** @Description
- ** Upload the all selected items to ftp server .
- **
- ** @Parameter
- ** LPCTSTR szRemotePath : the specify RemotePath ,
- if the path is NULL , get the cur path.
- **
- ** @Return: success return true , else false .
- ** @Author: Table.JHM.太子
- ** e-mail: tablejiang@21cn.com
- ** @Date: 2001 3 26
- ****************************************************/
- BOOL CDirListView::UploadSelectItem( LPCTSTR szRemotePath )
- {
- UINT i, uSelectedCount = m_ListCtrl.GetSelectedCount();
- int nItem = -1;
- if( !m_pFtp->IsConnect() )
- return false ;
- // upload all of the selected items.
- if (uSelectedCount > 0)
- {
- for (i=0;i < uSelectedCount;i++)
- {
- nItem = m_ListCtrl.GetNextItem(nItem, LVNI_SELECTED);
- ASSERT(nItem != -1);
- char szText[MAX_PATH] ;
- szText[0] = 0 ;
- m_ListCtrl.GetItemText( nItem , 0 , szText , MAX_PATH ) ;
- //up load.
- UploadFile( szText , NULL , nItem ) ;
- }
- }
- return true ;
- }
- /****************************************************
- ** @Description
- ** Upload a single file or directory to ftp server.
- **
- ** @Parameter
- ** LPCTSTR szName : the file name .
- LPCTSTR szRemotePath : the specify RemotePath ,
- if the path is NULL , get the cur path.
- int iSelItem : the item ,which be selected in list ctrl.
- **
- ** @Return: success return true ,else return false .
- ** @Author: Table.JHM.太子
- ** e-mail: tablejiang@21cn.com
- ** @Date: 2001 3 26
- ****************************************************/
- BOOL CDirListView::UploadFile( LPCTSTR szName , LPCTSTR szRemotePath , int iSelItem )
- {
- FTPFILEINFO FtpFile ;
- char szLocalPath[MAX_PATH] ;
- strcpy( szLocalPath , m_ListCtrl.GetNowListPath () ) ;
- ::ZeroMemory( &FtpFile , sizeof( FTPFILEINFO ) ) ;
- //get document .
- CQuickFTPDoc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
- //make site info.
- memcpy( &FtpFile.site , &m_pFtp->m_SiteInfo , sizeof( SITEINFO ) ) ;
- strcpy( FtpFile.remotefilename , szName ) ;
- if( szRemotePath == NULL )
- strcpy( FtpFile.remotepath , m_pFtp->m_CurrentFtpDirectory ) ;
- else
- strcpy( FtpFile.remotepath , szRemotePath ) ;
- //local info.
- strcpy( FtpFile.localfilename , szName ) ;
- strcpy( FtpFile.localpath , szLocalPath ) ;
- FtpFile.bfileput = true ;
- FtpFile.endpos = 0 ;
- FtpFile.startpos = 0 ;
- char szPathName[MAX_PATH] ;
- sprintf( szPathName , "%s%s" , FtpFile.localpath , FtpFile.localfilename );
- //is directory?
- if( PathIsDirectory( szPathName ) )
- FtpFile.bIsDirectory = true ;
- else
- FtpFile.bIsDirectory = false ;
- char szText[MAX_PATH] ;
- m_ListCtrl.GetItemText( iSelItem , 1 , szText , MAX_PATH ) ;
- FtpFile.filesize = _atoi64( szText ) ;
- m_ListCtrl.GetItemText( iSelItem , 3 , szText , MAX_PATH ) ;
- strcpy( FtpFile.filetime , szText ) ;
- //put get file.
- m_pFtp->PutGetFileToServer( &FtpFile ) ;
- pDoc->m_pFileQueue = &( m_pFtp->m_FileQueue );
- pDoc->UpdateAllViews( this ) ;
- return true ;
- }
- /****************************************************
- ** @Description
- ** the function is used for check the cursor pos .
- **
- ** @Parameter
- **
- **
- ** @Return: if the item be select or is file return false ,
- ** else return true .
- ** @Author: Table.JHM.太子
- ** e-mail: tablejiang@21cn.com
- ** @Date: 2001 3 26
- ****************************************************/
- BOOL CDirListView::CheckThePointPos( int index )
- {
- LVITEM lci ;
- char szText[MAX_PATH] ;
- char szPath[MAX_PATH] ;
- szText[0] = 0 ;
- memset( &lci , 0 , sizeof( LVITEM ) ) ;
- lci.mask = LVIF_TEXT | LVIF_STATE ;
- lci.pszText = szText ;
- lci.cchTextMax = MAX_PATH ;
- lci.iItem = index ;
- lci.iSubItem = 0 ;
- lci.stateMask = LVIS_SELECTED ;
- if( !m_ListCtrl.GetItem( &lci ) )
- return false ;
- //is item selected ?
- if( ( lci.state && LVIS_SELECTED ) )
- return false ;
- strcpy( szPath , m_ListCtrl.GetNowListPath() ) ;
- strcat( szPath , lci.pszText ) ;
- //is file or path ?
- if( PathIsDirectory( szPath ) )
- return true ;
- else
- return false ;
- }
- int CDirListView::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (CView::OnCreate(lpCreateStruct) == -1)
- return -1;
- // TODO: Add your specialized creation code here
- RECT rect ;
- GetClientRect( &rect ) ;
- //create combobox.
- rect.right -= 26 ;
- rect.bottom = 150 ;
- m_Combo.Create( WS_CHILD | WS_VISIBLE |WS_VSCROLL | WS_TABSTOP | CBS_DROPDOWNLIST
- , rect , this , IDC_COMBO1 ) ;
- //create listctrl.
- GetClientRect( &rect ) ;
- rect.top += 23 ;
- m_ListCtrl.SetParentWnd( m_hWnd ) ;
- m_ListCtrl.Create( WS_CHILD|WS_VISIBLE|LVS_REPORT ,
- rect , this , IDC_LISTCTRL1 ) ;
- //create button.
- GetClientRect( &rect ) ;
- rect.left = rect.right -26 ;
- rect.bottom = rect.top + 20 ;
- m_UpButton.Create( NULL , WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON|BS_OWNERDRAW ,
- rect , this , IDC_BACKBUTTON ) ;
- m_UpButton.LoadBitmaps( IDB_BITMAP_UP , IDB_BITMAP_DOWN , IDB_BITMAP_FOCUS , IDB_BITMAP_DISABLE ) ;
- m_UpButton.SizeToContent( ) ;
- //display init path .
- char CurPath[MAX_PATH] ;
- char driver[MAX_PATH] , path[MAX_PATH] , name[MAX_PATH] , ext[MAX_PATH] ;
- ::GetModuleFileName( NULL , CurPath , MAX_PATH ) ;
- _splitpath( CurPath , driver , path , name , ext ) ;
- _makepath( CurPath , driver , path , NULL , NULL ) ;
- m_ListCtrl.DisplayPath( CurPath ) ;
- m_Combo.SetDisplayStr( CurPath ) ;
- return 0;
- }
- /****************************************************
- ** @Description
- ** Add select item to back ground transmit queue.
- **
- ** @Parameter
- **
- **
- ** @Return:
- ** @Author: Table.JHM.太子
- ** e-mail: tablejiang@21cn.com
- ** @Date: 2001 3 26
- ****************************************************/
- BOOL CDirListView::AddSelectItemToBkTransmitQueue()
- {
- UINT i, uSelectedCount = m_ListCtrl.GetSelectedCount();
- int nItem = -1;
- if( !m_pFtp->IsConnect() )
- return false ;
- // add all of the selected items.
- if (uSelectedCount > 0)
- {
- for (i=0;i < uSelectedCount;i++)
- {
- nItem = m_ListCtrl.GetNextItem(nItem, LVNI_SELECTED);
- ASSERT(nItem != -1);
- char szText[MAX_PATH] ;
- szText[0] = 0 ;
- m_ListCtrl.GetItemText( nItem , 0 , szText , MAX_PATH ) ;
- AddItemToBkQueue( szText , NULL , nItem ) ;
- }
- }
- return true ;
- }
- /****************************************************
- ** @Description
- ** add a item to back ground transmit.
- **
- ** @Parameter
- **
- **
- ** @Return:
- ** @Author: Table.JHM.太子
- ** e-mail: tablejiang@21cn.com
- ** @Date: 2001 3 26
- ****************************************************/
- BOOL CDirListView::AddItemToBkQueue(LPSTR szName, LPCTSTR path, int iSelItem)
- {
- FTPFILEINFO FtpFile ;
- char szLocalPath[MAX_PATH] ;
- strcpy( szLocalPath , m_ListCtrl.GetNowListPath () ) ;
- ::ZeroMemory( &FtpFile , sizeof( FTPFILEINFO ) ) ;
- //get document .
- CQuickFTPDoc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
- memcpy( &FtpFile.site , &m_pFtp->m_SiteInfo , sizeof( SITEINFO ) ) ;
- strcpy( FtpFile.remotefilename , szName ) ;
- strcpy( FtpFile.remotepath , m_pFtp->m_CurrentFtpDirectory ) ;
- strcpy( FtpFile.localfilename , szName ) ;
- strcpy( FtpFile.localpath , szLocalPath ) ;
- FtpFile.bfileput = true ;
- FtpFile.endpos = 0 ;
- FtpFile.startpos = 0 ;
- char szPathName[MAX_PATH] ;
- sprintf( szPathName , "%s%s" , FtpFile.localpath , FtpFile.localfilename );
- if( PathIsDirectory( szPathName ) )
- FtpFile.bIsDirectory = true ;
- else
- FtpFile.bIsDirectory = false ;
- char szText[MAX_PATH] ;
- m_ListCtrl.GetItemText( iSelItem , 1 , szText , MAX_PATH ) ;
- FtpFile.filesize = _atoi64( szText ) ;
- m_ListCtrl.GetItemText( iSelItem , 3 , szText , MAX_PATH ) ;
- strcpy( FtpFile.filetime , szText ) ;
- m_pBkTransmitDlg->AddToBkQueue( &FtpFile ) ;
- return true ;
- }
- /****************************************************
- ** @Description
- **
- **
- ** @Parameter
- **
- **
- ** @Return:
- ** @Author: Table.JHM.太子
- ** e-mail: tablejiang@21cn.com
- ** @Date: 2001 3 26
- ****************************************************/
- BOOL CDirListView::RefreshCurDir()
- {
- m_ListCtrl.DisplayPath( m_ListCtrl.GetNowListPath() ) ;
- m_Combo.SetDisplayStr( m_ListCtrl.GetNowListPath() ) ;
- return true ;
- }
- void CDirListView::OnLocalDelete()
- {
- // TODO: Add your command handler code here
- m_ListCtrl.DeleteSelectItem( ) ;
- }
- void CDirListView::OnLocalDownload()
- {
- // TODO: Add your command handler code here
- }
- void CDirListView::OnLocalRefresh()
- {
- // TODO: Add your command handler code here
- RefreshCurDir( ) ;
- }
- void CDirListView::OnLocalUpload()
- {
- // TODO: Add your command handler code here
- UploadSelectItem( NULL ) ;
- }
- void CDirListView::OnRButtonDown(UINT nFlags, CPoint point)
- {
- // TODO: Add your message handler code here and/or call default
- CView::OnRButtonDown(nFlags, point);
- }
- void CDirListView::OnSelectAll()
- {
- // TODO: Add your command handler code here
- m_ListCtrl.SelectAllItem( ) ;
- }