00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(AFX_DLGFILECOPY_H__35C04685_7B85_4022_A702_983686FCBD9B__INCLUDED_)
00023 #define AFX_DLGFILECOPY_H__35C04685_7B85_4022_A702_983686FCBD9B__INCLUDED_
00024
00025 #pragma once
00026
00027 #include "DlgSkinDialog.h"
00028 #include "CtrlSharedFolder.h"
00029
00030 class CLibraryFile;
00031
00032
00033 class CFileCopyDlg : public CSkinDialog
00034 {
00035
00036 public:
00037 CFileCopyDlg(CWnd* pParent = NULL, BOOL bMove = FALSE);
00038
00039
00040 public:
00041
00042 enum { IDD = IDD_FILE_COPY };
00043 CStatic m_wndMove;
00044 CStatic m_wndCopy;
00045 CStatic m_wndFileName;
00046 CProgressCtrl m_wndFileProg;
00047 CButton m_wndCancel;
00048 CButton m_wndOK;
00049 CProgressCtrl m_wndProgress;
00050 CStatic m_wndPlaceholder;
00051
00052
00053
00054 public:
00055 CString m_sTarget;
00056 protected:
00057 BOOL m_bMove;
00058 CPtrList m_pFiles;
00059 CLibraryFolderCtrl m_wndTree;
00060 DWORD m_nCookie;
00061 protected:
00062 HANDLE m_hThread;
00063 BOOL m_bThread;
00064 BOOL m_bCancel;
00065 int m_nFileProg;
00066
00067
00068 public:
00069 void AddFile(CLibraryFile* pFile);
00070 protected:
00071 void StartOperation();
00072 void StopOperation();
00073 void OnRun();
00074 BOOL ProcessFile(CString& strName, CString& strPath, BOOL bMetaData);
00075 BOOL CheckTarget(LPCTSTR pszTarget);
00076 BOOL ProcessMove(LPCTSTR pszSource, LPCTSTR pszTarget);
00077 BOOL ProcessCopy(LPCTSTR pszSource, LPCTSTR pszTarget);
00078 protected:
00079 static UINT ThreadStart(LPVOID pParam);
00080 static DWORD WINAPI CopyCallback(LARGE_INTEGER TotalFileSize, LARGE_INTEGER TotalBytesTransferred, LARGE_INTEGER StreamSize, LARGE_INTEGER StreamBytesTransferred, DWORD dwStreamNumber, DWORD dwCallbackReason, HANDLE hSourceFile, HANDLE hDestinationFile, LPVOID lpData);
00081
00082
00083
00084 public:
00085
00086 protected:
00087 virtual void DoDataExchange(CDataExchange* pDX);
00088 virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
00089
00090
00091
00092 protected:
00093
00094 virtual BOOL OnInitDialog();
00095 virtual void OnOK();
00096 afx_msg void OnTimer(UINT nIDEvent);
00097 virtual void OnCancel();
00098
00099 DECLARE_MESSAGE_MAP()
00100
00101 };
00102
00103
00104
00105 #define IDC_FOLDERS 100
00106
00107 #endif // !defined(AFX_DLGFILECOPY_H__35C04685_7B85_4022_A702_983686FCBD9B__INCLUDED_)