www.pudn.com > ShellMon.rar > main.h


//--------------------------------------------------------------------------- 
 
#ifndef mainH 
#define mainH 
//--------------------------------------------------------------------------- 
#include  
#include  
#include  
#include  
#include  
#include "KeyLog.h" 
 
#define  WM_SHNOTIFY            0x401 
 
typedef struct{ 
        PItemIDList dwItem1; 
        PItemIDList dwItem2; 
}SHNOTIFYSTRUCT, *PSHNOTIFYSTRUCT; 
 
typedef struct{ 
        PItemIDList pidl; 
        int bWatchSubFolders; 
}_IDLSTRUCT,IDLSTRUCT,*PIDLSTRUCT; 
 
typedef HWND (*SHNRegister)(HWND hWnd,DWORD uFlags,DWORD dwEventID,DWORD uMSG,DWORD cItems,PIDLSTRUCT lpps); 
typedef HWND (*SHNUnRegister)(HWND hNotify); 
 
//--------------------------------------------------------------------------- 
class TfrmMain : public TForm 
{ 
__published:	// IDE-managed Components 
        TMemo *Memo1; 
        void __fastcall FormCreate(TObject *Sender); 
        void __fastcall FormClose(TObject *Sender, TCloseAction &Action); 
private: 
        HWND m_hSHNotify; 
        LPITEMIDLIST m_pidlDesktop; 
 
        SHNRegister SHChangeNotifyRegister; 
        SHNUnRegister SHChangeNotifyDeregister; 
 
        bool __fastcall SHNotify_Register(HWND hWnd); 
        bool __fastcall SHNotify_UnRegister(); 
         
        AnsiString __fastcall SHEventName(AnsiString strPath1,AnsiString strPath2,DWORD lParam); 
 
        void __fastcall WMShellReg(TMessage & Message); 
        void __fastcall WMKeyLog(TMessage & Message);	// User declarations 
public:		// User declarations 
        __fastcall TfrmMain(TComponent* Owner); 
protected: 
        BEGIN_MESSAGE_MAP 
                VCL_MESSAGE_HANDLER(WM_SHNOTIFY, TMessage, WMShellReg) 
                VCL_MESSAGE_HANDLER(WM_KEYLOG, TMessage, WMKeyLog) 
        END_MESSAGE_MAP(TForm) 
}; 
//--------------------------------------------------------------------------- 
extern PACKAGE TfrmMain *frmMain; 
//--------------------------------------------------------------------------- 
#endif