Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" ( _ ByVal idHook As Long, _ ByVal lpfn As Long, _ ByVal hmod As Long, _ ByVal dwThreadId As Long) As Long
В успешном случае возвращается дескриптор процедуры-ловушки. В противном случае возвращается 0. Для получения кода ошибки используйте GetLastError
WH_CALLWNDPROC | Installs a hook procedure that monitors messages before the system sends them to the destination window procedure. For more information, see the CallWndProc hook procedure. |
WH_CALLWNDPROCRET | Installs a hook procedure that monitors messages after they have been processed by the destination window procedure. For more information, see the CallWndRetProc hook procedure. |
WH_CBT | Ловушка, позволяющая получать уведомляющие сообщения: активация, создание, уничтожение, изменение размеров, смена фокуса окна |
WH_DEBUG | Installs a hook procedure useful for debugging other hook procedures. For more information, see the DebugProc hook procedure. |
WH_FOREGROUNDIDLE | Installs a hook procedure that will be called when the application's foreground thread is about to become idle. This hook is useful for performing low priority tasks during idle time. For more information, see the ForegroundIdleProc hook procedure. |
WH_GETMESSAGE | Перехватывает любое оконное сообщение |
WH_JOURNALPLAYBACK | Installs a hook procedure that posts messages previously recorded by a WH_JOURNALRECORD hook procedure. For more information, see the JournalPlaybackProc hook procedure. |
WH_JOURNALRECORD | Installs a hook procedure that records input messages posted to the system message queue. This hook is useful for recording macros. For more information, see the JournalRecordProc hook procedure. |
WH_KEYBOARD | Обрабатывает любые события клавиатуры |
WH_KEYBOARD_LL = 13 | Windows NT/2000/XP: Обрабатывает любые события клавиатуры. Смотри LowLevelKeyboardProc |
WH_MOUSE | Перехватывает любые события мыши: Текущее положение курсора, состояние кнопок и т.п. |
WH_MOUSE_LL | Windows NT/2000/XP: Installs a hook procedure that monitors low-level mouse input events. For more information, see the LowLevelMouseProc hook procedure. |
WH_MSGFILTER | Installs a hook procedure that monitors messages generated as a result of an input event in a dialog box, message box, menu, or scroll bar. For more information, see the MessageProc hook procedure. |
WH_SHELL | Installs a hook procedure that receives notifications useful to shell applications. For more information, see the ShellProc hook procedure. |
WH_SYSMSGFILTER | Installs a hook procedure that monitors messages generated as a result of an input event in a dialog box, message box, menu, or scroll bar. The hook procedure monitors these messages for all applications in the same desktop as the calling thread. For more information, see the SysMsgProc hook procedure. |
Смотри пример disablekeys.zip