---
name: "SetWinEventHook"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/SetWinEventHook"
---

# SetWinEventHook(3w)

## NAME

**SetWinEventHook** (USER32.@)

## SYNOPSIS

HWINEVENTHOOK SetWinEventHook\
  (\
   DWORD        *event\_min*,\
   DWORD        *event\_max*,\
   HMODULE      *inst*,\
   WINEVENTPROC *proc*,\
   DWORD        *pid*,\
   DWORD        *tid*,\
   DWORD        *flags*\
  )

## DESCRIPTION

Set up an event hook for a set of events.

## PARAMS

*event\_min* **\[In\]**  Lowest event handled by pfnProc.

*event\_max* **\[In\]**  Highest event handled by pfnProc.

*inst* **\[In\]**  dll containing pfnProc.

*proc* **\[In\]**  Callback event hook function.

*pid* **\[In\]**  Process to get events from, or **0** for all processes.

*tid* **\[In\]**  Thread to get events from, or **0** for all threads.

*flags* **\[In\]**  Flags indicating the status of pfnProc.

## RETURNS

**Success:** A handle representing the hook.

**Failure:** A **NULL** handle.

## IMPLEMENTATION

Declared in **"winuser.h"**.

Implemented in **"dlls/user32/hook.c"**.

Debug channel **"hook"**.
