Show / Hide Table of Contents

Constructor WinEventHook.WinEventHook(+ 1 overload)


Overload

Sets a hook for an event or a range of events.

public WinEventHook(EEvent eventMin, EEvent eventMax, Action<HookData.WinEvent> hookProc, int idProcess = 0, int idThread = 0, EHookFlags flags = EHookFlags.None)
Parameters
eventMin  (EEvent)

The lowest event constant value in the range of events. Can be EEvent.MIN to indicate the lowest possible event value. Events reference: SetWinEventHook. Value 0 is ignored.

eventMax  (EEvent)

The highest event constant value in the range of events. Can be EEvent.MAX to indicate the highest possible event value. If 0, uses eventMin.

hookProc  (Action<HookData.WinEvent>)

The hook procedure (function that handles hook events).

idProcess  (int)

The id of the process from which the hook function receives events. If 0 - all processes on the current desktop.

idThread  (int)

The native id of the thread from which the hook function receives events. If 0 - all threads.

flags  (EHookFlags)
Exceptions
AuException

Failed.

Examples

See WinEventHook.


Overload(top)

Sets multiple hooks.

public WinEventHook(EEvent[] events, Action<HookData.WinEvent> hookProc, int idProcess = 0, int idThread = 0, EHookFlags flags = EHookFlags.None)
Parameters
events  (EEvent[])

Events. Reference: API SetWinEventHook. Elements with value 0 are ignored.

hookProc  (Action<HookData.WinEvent>)

The hook procedure (function that handles hook events).

idProcess  (int)

The id of the process from which the hook function receives events. If 0 - all processes on the current desktop.

idThread  (int)

The native id of the thread from which the hook function receives events. If 0 - all threads.

flags  (EHookFlags)
Exceptions
AuException

Failed.

Examples

See WinEventHook.