Name
SetWindowsHookEx
Synopsis
Installs the specified window’s hook:
Public 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
Parameters
-
idHook This is the identifier of the type of hook that is being installed.
-
lpfn Function pointer that points to the hook callback function.
-
hmod The handle of the DLL containing the hook callback function. If this is
NULL, the hook callback function is not contained within a DLL. Instead, it is contained in the application’s (EXE’s) code.-
dwThreadId The application’s thread that contains the hook callback function. If this is
NULL, the hook callback function is contained within a DLL (seehmod).
Return Value
Returns the handle to the newly created hook. A return value of zero indicates failure.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access