#pragma once #include "afxwin.h" #include // MFC OLE Ŭ·¡½ºÀÔ´Ï´Ù. #include // MFC OLE ´ëÈ­ »óÀÚ Å¬·¡½ºÀÔ´Ï´Ù. #include // MFC ÀÚµ¿È­ Ŭ·¡½ºÀÔ´Ï´Ù. #include "TranTabCtrl.h" #include "WebBrowser2.h" #include "TextProgressCtrl.h" #include "RegUtil.h" #include "../ConsoleApp/Struct.h" typedef struct { bool bFolder; CString sText; CString sSrcPath; CString sDstPath; __int64 nSize; __int64 nTransferredSize; CString sLastModified; int nState; // -1:Àü¼ÛÁß, 0:Àü¼ÛÀü, 1:¿Ï·á, 2:¿¡·¯, 3:°Ç³Ê¶Ü, 4:ÁßÁö, 5:ÀϽÃÁ¤Áö } TRANFILE_STRUCT, *PTRANFILE_STRUCT; enum TRANFILE_STATE { TFS_TRANSFERRING = -1, TFS_READY = 0, TFS_COMPLETE, TFS_ERROR, TFS_SKIPED, TFS_STOP, TFS_PAUSE, }; #define WMU_TRANSFER_IS_READY (WM_USER + 1) #define WMU_TRANSFER (WM_USER + 2) #define WMU_TRANSFER_COMPLETED (WM_USER + 3) #define WMU_TRANSFER_ERROR (WM_USER + 4) #define WMU_TRANSFER_CLOSE (WM_USER + 5) #define TIMER_ID_CLOSE 1 #define TIMER_ID_UPDATESTATUS 2 #define TIMER_ID_TRANSFER 3 // CTransferDlg ´ëÈ­ »óÀÚÀÔ´Ï´Ù. class CTransferDlg : public CDialog { DECLARE_DYNAMIC(CTransferDlg) public: CTransferDlg(CWnd* pParent = NULL); // Ç¥ÁØ »ý¼ºÀÚÀÔ´Ï´Ù. virtual ~CTransferDlg(); // ´ëÈ­ »óÀÚ µ¥ÀÌÅÍÀÔ´Ï´Ù. enum { IDD = IDD_TRANSFER }; protected: HCOMMLIB m_hcl; map m_mapTranFile; CPtrArray m_paTranFile; CString m_sTitle; bool m_bPaused; bool m_bResume; bool m_bStop; CWinThread* m_pthread; bool m_bUpdating; int m_nTotalCount; UINT64 m_nTotalSize; UINT64 m_nTotalTransferred; double m_nTransferSpeed; UINT64 m_nSpeedTransferred; DWORD m_nSpeedTick; int m_iTransfer; CTime m_tmStart; __int64 m_nElapsed; DWORD m_dwOldTick; double m_nGapTransfer; int m_nSelectedCount; UINT64 m_nSelectedSize; UINT64 m_nCurrentFileSize; UINT64 m_nBaseFileSize; UINT64 m_nTransferredSize; int m_nWriteAction; BOOL m_bWriteApplyAll; UINT m_nTimer; CString m_sSkippedFolder; DWORD m_dwError; CString m_sError; public: CWebBrowser2 m_wbAdvert; CTranTabCtrl m_tab; CButton m_btnDelFile; CString m_sFolder; CListCtrl m_list; CStatic m_stcStatus; CStatic m_grpNow; CStatic m_stcSpeedTitle; CStatic m_stcSpeed; CStatic m_stcSaveFileTitle; CStatic m_stcSaveFile; CTextProgressCtrl m_prsNow; CStatic m_grpTotal; CStatic m_stcETimeTitle; CStatic m_stcETime; CStatic m_stcLTimeTitle; CStatic m_stcLTime; CStatic m_stcFileCountTitle; CStatic m_stcFileCount; CTextProgressCtrl m_prsTotal; CButton m_btnStart; CButton m_btnPause; CButton m_btnClose; TRANPARAM_STRUCT m_tp; LPSTR m_pszFileList; protected: void InitTransferEnv(); int GetAction(CString sOldObj, CString sOldMTime, UINT64 nOldSize, CString sNewObj, CString sNewMTime, UINT64 nNewSize); bool AppendRemoteFile(CString sPath); bool AppendLocalFile(CString sPath, int nDepth); void AppendFile(CString sPath, UINT64 nSize, CString sLastModified, int nDepth, int iPos = -1); void ShowFileCount(); void ShowTotalProgress(); void LoadWritePolicy(); void ShowProgressStatus(UINT64 nTransferred); static UINT LoadTransferFile(LPVOID); static void TransferCallbackProc(LPVOID, __int64 nTransfered); void RedrawControl1(); void RedrawControl2(); public: void Pause(bool bPause = true); void Resume(); void ShowStatus(bool bSelected = false, bool bUpdate = true, bool bAllSelected = false); DECLARE_EVENTSINK_MAP() void DocumentCompleteWBAdvert(LPDISPATCH pDisp, VARIANT* URL); void NavigateErrorWBAdvert(LPDISPATCH pDisp, VARIANT* URL, VARIANT* Frame, VARIANT* StatusCode, BOOL* Cancel); protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV Áö¿øÀÔ´Ï´Ù. DECLARE_MESSAGE_MAP() public: virtual BOOL OnInitDialog(); afx_msg void OnClose(); afx_msg void OnTimer(UINT nIDEvent); afx_msg void OnBtnDelfile(); afx_msg void OnBtnStart(); afx_msg void OnBtnPause(); afx_msg void OnBtnClose(); afx_msg void OnListItemChanged(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnListKeydown(NMHDR *pNMHDR, LRESULT *pResult); afx_msg LRESULT OnTransferIsReady(WPARAM, LPARAM); afx_msg LRESULT OnTransfer(WPARAM, LPARAM); afx_msg LRESULT OnTransferCompleted(WPARAM, LPARAM); afx_msg LRESULT OnTransferError(WPARAM, LPARAM); afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); };