Жаль, что Вы не послушали совета читать msdn.

Или прочитали не внимательно, что тоже прискорбно
По хэндлу...
<blockquote><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Цитата:</font><hr>
HHOOK SetWindowsHookEx(
int idHook, // hook type
HOOKPROC lpfn, // hook procedure
HINSTANCE hMod, // handle to application instance
DWORD dwThreadId // thread identifier
);
[...]
hMod
[in] Handle to the DLL containing the hook procedure pointed to by the lpfn parameter. The hMod parameter must be set to NULL if the dwThreadId parameter specifies a thread created by the current process and if the hook procedure is within the code associated with the current process.
<hr></blockquote>
Дальше...
<blockquote><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Цитата:</font><hr>
Calling the CallNextHookEx function to chain to the next hook procedure is optional, but it is
highly recommended; otherwise, other applications that have installed hooks will not receive hook notifications and may behave incorrectly as a result. You should call CallNextHookEx unless you absolutely need to prevent the notification from being seen by other applications.
<hr></blockquote>
Этих рекомендаций придерживаетесь?
Не хочу повторятся, но MSDN никто не отменял.
Кроме того, следует иметь ввиду, что...
<blockquote><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Цитата:</font><hr> The global hooks are a shared resource, and installing one affects all applications in the same desktop as the calling thread. All global hook functions must be in libraries. Global hooks should be restricted to special-purpose applications or to use as a development aid during application debugging. Libraries that no longer need a hook should remove its hook procedure.
<hr></blockquote>