Can we set a global hook in a COM object?
-
in the SetWindowsHookEx function, I set the _pModule->get_m_hInst() as the HINSTANCE parameter. The relust of this code is a local hook on the procedure. "Global hook procedures should be placed in a separate DLL". is com is a separate DLL hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, LowLevelKeyboardProc, _pModule->get_m_hInst(), 0); a related article is talking about the subject in a standart DLL (not COM). http://www.codeproject.com/win32/AntonioWinLock.asp
-
in the SetWindowsHookEx function, I set the _pModule->get_m_hInst() as the HINSTANCE parameter. The relust of this code is a local hook on the procedure. "Global hook procedures should be placed in a separate DLL". is com is a separate DLL hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, LowLevelKeyboardProc, _pModule->get_m_hInst(), 0); a related article is talking about the subject in a standart DLL (not COM). http://www.codeproject.com/win32/AntonioWinLock.asp
I don't see why it couldn't work. Why don't you just try it? -- My name in Katakana is ヨルゲン. My name in German is Jörgen. My name in Mandarin/Kanji is 乔尔根 西格瓦德森. I blog too now[^]
-
in the SetWindowsHookEx function, I set the _pModule->get_m_hInst() as the HINSTANCE parameter. The relust of this code is a local hook on the procedure. "Global hook procedures should be placed in a separate DLL". is com is a separate DLL hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, LowLevelKeyboardProc, _pModule->get_m_hInst(), 0); a related article is talking about the subject in a standart DLL (not COM). http://www.codeproject.com/win32/AntonioWinLock.asp
Hi nadzzz, Is ur com object a dll ? - If it is then u can't install global hook, to install global hook ur application must be an exe (rather than dll) See the global hook docs for more info. :) Cheers, Vishal