The global hook is to use DLL to use. Because only hook procedure is in the DLL, it can be injected in the address space of other threads by Windows. A program always takes a DLL to always be uncomfortable. Do you have a global hook that you can use without DLL?
Of course,:
WH_KEYBOARD_LLWindows NT / 2000 / XP: Installs a hook procedure that monitors low-level keyboard input events WH_MOUSE_LLWindows NT / 2000 / XP:. Installs a hook procedure that monitors low-level mouse input events.
These two hooks that record low-level mouse and keyboard messages can be used directly in EXE and do not require DLL, the minimum system requirements for using these two hooks are Windows NT 4.0 SP3 or above.
Here is an MSDN routine: (shielded Alt ESC, Ctrl ESC, Alt Tab)
/ ************************************************** ********************** MODULE: DisablelowlevelKeys.cppNotices: Written 2000 Jeffrey Richter *************************** *********************************************************** ******* /
#define _win32_winnt 0x0400 // When _win32_winnt> = 0x0400 when WH_KEYBOARD_LL is defined #include
/
LRESULT CALLBACK LowLevelKeyboardProc (int nCode, WPARAM wParam, LPARAM lParam) {BOOL fEatKeystroke = FALSE; if (nCode == HC_ACTION) {switch (wParam) {case WM_KEYDOWN: case WM_SYSKEYDOWN: case WM_KEYUP: case WM_SYSKEYUP: PKBDLLHOOKSTRUCT p = (PKBDLLHOOKSTRUCT) LParam; featKeystroke = ((p-> vkcode == vk_tab) && ((p-> flags & llkhf_altdown)! = 0)) || ((p-> vkcode == vk_escape) && ((p-> flags & llkhf_altdown )! = 0)) || ((p-> vkcode == vk_escape) && ((getKeyState (VK_Control) & 0x8000)! = 0)); Break;}} return (featKeystroke} Return (featKexThookex (null, ncode, WPARAM, LPARAM);
/