Hook拦截自定义消息,已经解决了。(100)

C

ch2001023

Unregistered / Unconfirmed
GUEST, post messages is not allowed!
const WM_CloseHook = WM_User + 100; //自定义消息,主程序,和DLL必须申明PostMessage(Handle, WM_CloseHook, 0, 0); //Handle 为主程序句柄。WmHook := SetWindowsHookEx(WH_GETMESSAGE,@WMHookPRO, HInstance, 0);//配合PostMessage使用{回调函数}function WMHookPRO(nCode: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;begin if nCode = HC_ACTION then if PMsg(lParam)^.message = WM_CloseHook then begin .... end; Result := CallNextHookEx(WmHook, nCode, wParam, lParam);end;
 
S

szhcracker

Unregistered / Unconfirmed
GUEST, post messages is not allowed!
S

sunnyfairy

Unregistered / Unconfirmed
GUEST, post messages is not allowed!
接分的.
 
T

terry_zhou82

Unregistered / Unconfirmed
GUEST, post messages is not allowed!
我也是,给我点啊
 
Top Bottom