使用soui开发的mbc,只支持windows版本
w1146869587
2022-01-24 479b1995ef435713c2cf4f0da8de3a6af6c30922
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#pragma once
 
#include <afxmt.h>
#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();
 
};