Good evening
I've search a lot of forums but did not found any answer to my question. So here I post it.
I'm trying to set hook to keyboard to receive all multimedia keys notification, for altering they default behavior or simply disable them. But I've run into some problem.
In my .exe file I call functions from .dll which simply sets the hook with this code
Then goes the handling like thisCode:SetWindowsHookEx( WH_SHELL, ShellProc, gModule, 0 );
Everything works correctly to the moment o losing the focus, after that my application simply stops receiving the notifications. When setting the focus back to my app it start working again.Code:LRESULT CALLBACK ShellProc(int nCode, WPARAM wParam, LPARAM lParam) { if (nCode >= 0 ) { switch( wParam ) { // here I would like to handle WH_SHELL -> HSHELL_APPCOMMAND -> ie. APPCOMMAND_LAUNCH_APP2 } } // if return CallNextHookEx (gHookProc, nCode, wParam, lParam); }
Do I need to set up sth more? Switch sth in the system? Disable sth?
I use the m$ way to link the .exe with .dll with dllimport/dllexport. No dynamic load of .dll.
My system is Vista64. I don't have any drivers for my keyboard I use the ones that comes with vista.
Please help.
J.
//EDIT: syntax error fix





Reply With Quote
