Y
ysq
Unregistered / Unconfirmed
GUEST, unregistred user!
我做了一个shellhook,但奇怪的是他只能得到本进程的窗口创建等一系列消息,对于其他进程创建的窗口就不会引发这个hook,真得很奇怪。我现在想hook其他窗口创建和destroy怎么办?下面是我的代码。<br><br>function shellHookProc(iCode:Integer;wParam1:wParam;lParam1:lParam):LRESULT;stdcall;<br>begin<br> Result:=0;<br> DebugOutput(inttostr(iCode));<br> if iCode<0 then Result := CallNextHookEx(hHook1,iCode,wParam1,lParam1);<br>end;<br><br>procedure SetshellHook(hnd:HWND);<br>begin<br> hHook1:=SetwindowsHookEx(WH_SHELL,TaskHookProc,hInstance,0);<br> if hHook1 <=0 then messagebox(0,'hookError','task',16);<br>end;<br><br>procedure RemoveshellHook;<br>begin<br> UnhookWindowsHookEx(hhook1);<br>end;<br>