SetWindowsHookEx function user32

int SetWindowsHookEx(
  1. int idHook,
  2. Pointer<NativeFunction<HOOKPROC>> lpfn,
  3. int hmod,
  4. int dwThreadId
)

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);