I have another problem with that hook stuff.
Everytime i set a thread spec. hook (a cbt hook), the hook will "block" the whole system. I set a thread spec. hook (and i know that the thread is valid and exactly the thread i want). but it's always the same thing: when an event occurs that causes my hook procedure to be executed, nothing works anymore. the window (yes the window belongs to that thread) does not seem to process any messages anymore.
what's wrong there? the hook proc resides in a dll. i know that it doesn't have to be in a dll for a thread spec. hook, but it can be, or not?
my hook proc always returns 0, so the operation that caused the hook to be executed will be allowed.
i don't know where the problem is. any ideas what it could be?
Posted on 2001-09-16 06:42:11 by darester
Do you make a call to CallNextHookEx or CallNextHook in your hoop procedure? In C you should have something similar this one:

LRESULT CALLBACK HookProc(int nCode, WPARAM wParam, LPARAM lParam)
LPMSG lpMsg;

lpMsg = (LPMSG)lParam;

if (lpMsg->message == WM_XXX)
// do something

return CallNextHookEx(g_hNextHook, nCode, wParam, lParam);
Posted on 2001-09-16 10:10:47 by LuHa
i call CallNextHookEx at the beginning of my proc and at the end i return a value depending on the message (i do not return the return value of CallNextHookEx).
Posted on 2001-09-16 13:00:36 by darester
It should be ok... I can't help you, sorry.
Posted on 2001-09-16 16:21:05 by LuHa
did you remember to save the ebx edi and esi registers?
Posted on 2001-09-17 04:07:48 by beaster
thanks for all your help.
the problem had to do something with shared memory...
Posted on 2001-09-17 08:58:42 by darester