"Shell Hooks" - care to comment ?
Posted on 1997-12-02
Anybody willing to comment on using ShellProcs ?
i (think) i have followed the specs to the letter, but the computer doesn't like it.
i'm installing a system wide hook (yes, in a DLL) and setting the hook by
InstDLL := GetModuleHandle ('MyHook.DLL');
hProc := SetWindowsHookEx (WH_SHELL, MyHook, InstDll, 0);
i have also tried to set it within the DLL by
hProc := SetWindowsHookEx (WH_SHELL, MyHook, 0, 0);
and i am not doing much in "MyHook" proc either: i am just sending a message to the main window (i have the main handle passed to the DLL before it). it goes like this:
function MyHook(nCode: integer; wp: WPARAM; lp: LPARAM): LRESULT;stdcall;
if(nCode >= 0) then
SendMessage(Caller, wm_User+1, wp, nCode);
Result := CallNextHookEx(hook, nCode, wp, lp);
[variables Caller & Hook are defined]
but the Hook function only for the process and not systemwide and often it causes a GPF in Kernel32 !
Any comments ....?