Hi All,

I need to catch all keyboard event and some of the keyboard keys i need to intercept.
So i using windows hook to do it.

But in some reason when i do "SetWindowsHookEx" i getting wrong return code and my hook does not working.

This is my code ( just the relevant part ):


LRESULT CALLBACK KeyboardProc(int code, // hook code
WPARAM wParam, // virtual-key code
LPARAM lParam // keystroke-message information
)
{
LRESULT lRetCode = 0;

return lRetCode;
}

LRESULT SetHook()
{

HINSTANCE hinstance = NULL;
HHOOK hookHandle = NULL;
LRESULT lRetCode = 0;

hookHandle = SetWindowsHookEx(WH_KEYBOARD, KeyboardProc, hinstance, 0);

return lRetCode;
}



What i did wronge ?

Thanks for any help.