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

  • 主题发起人 主题发起人 ch2001023
  • 开始时间 开始时间
C

ch2001023

Unregistered / Unconfirmed
GUEST, unregistred user!
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;
 
我也是,给我点啊
 

Similar threads

后退
顶部