#pragma once #include #include "Event.h" #include "OIObj.h" #define WM_FILEMD5_FINISH ( WM_USER + 1210 ) // MD5 Éú³ÉÍê³É£ºCString *pstrFilePath, CString *pstrFileMD5 #define WM_FILEMD5_ERROR ( WM_USER + 1211 ) // MD5 Éú³Éʧ°Ü£ºCString *pstrFilePath, 0 //======================================================================================== // CMD5FileItem command target class CMD5FileItem : public COIObj { public: CMD5FileItem(); CMD5FileItem( CString strFilePath, HWND hOwnerWnd ); virtual ~CMD5FileItem(); // Attributers public: CString m_strFilePath; // Îļþ·¾¶ HWND m_hOwnerWnd; // ËùÊô´°¿Ú¾ä±ú // Operations public: static void DetachList( CPtrList &listFile ); bool IsMatch( CString strFilePath, HWND hWnd ); bool IsMatch( CString strFilePath ); }; //======================================================================================== // CFileMD5GenMgr command target class AFX_EXT_CLASS CFileMD5GenMgr { public: CFileMD5GenMgr(); virtual ~CFileMD5GenMgr(); // Attributers public: protected: HANDLE m_hThread; // Ï߳̾ä±ú CManualResetEvent m_eventGen; // ÓÐÊý¾ÝÐèÒªÉú³É CManualResetEvent m_eventShutdown; // Í£µôÏß³Ì CCriticalSection m_cs; CPtrList m_listFile; // ÎļþÁбí char m_szFileMD5[33]; // Operations public: bool Start(); void Stop(); void AddFile( CString strFilePath, HWND hOwnerWnd ); void RemoveFile( CString strFilePath, HWND hOwnerWnd = NULL ); CMD5FileItem * GetHeadFile(); // µÃµ½µÚÒ»¸öÎļþ private: static unsigned int __stdcall _ThreadFunction( void *pV ); int Run(); void ProcessFileMD5(); };