var MemFile: THandle; Shared: PShared; function ShellProc(iCode: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall; begin case iCode of HSHELL_WINDOWCREATED: //有顶级窗口创建时向演示程序发送自己定义消息WM_USERCMD. Wparamr参数说明 // wParam specifies the handle of the window being created or destroyed, respectively. PostMessage(Shared^.MainWnd,WM_USERCMD ,UC_WINCREATE,wParam); end; Result := CallNextHookEx(Shared^.ShellHook,iCode,wParam,lParam); end; function InstallHook:Boolean; |