SetWindowsHookEx function user32
Installs an application-defined hook procedure into a hook chain. You would install a hook procedure to monitor the system for certain types of events. These events are associated either with a specific thread or with all threads in the same desktop as the calling thread.
HHOOK SetWindowsHookExW(
int idHook,
HOOKPROC lpfn,
HINSTANCE hmod,
DWORD dwThreadId
);
Implementation
int SetWindowsHookEx(int idHook, Pointer<NativeFunction<HOOKPROC>> lpfn,
int hmod, int dwThreadId) =>
_SetWindowsHookEx(idHook, lpfn, hmod, dwThreadId);