simplified WinEvents

Post your working scripts, libraries and tools
User avatar
KuroiLight
Posts: 320
Joined: 12 Apr 2015, 20:24
GitHub: KuroiLight

simplified WinEvents

10 Jan 2018, 20:54

I tried to simplify SetWinEventHook as much as I could for ease of usage. May expand it later.
You can set a WinEvent hook for any of the available events without the min/max range requirement.
You can add events to a callbacks hook after initial usage and remove events from the hook without removing all of them.

To Add an event hook use:
HookEvent(functionname, events, pid := "0", flags := "0")
functionname is a string name of the function, processId filter and dwflags optional, events must be an array of event constants (listed in WinEvents.ahk)
the function specified by function name must have the definition like: WinEventProc(hHook, event, hwnd, idObject, idChild, dwEventThread, dwmsEventTime)
To remove an event hook use:
UnHookEvent(functionname, events)
params same as above

WinEvents.ahk:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Eample Usage:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Last edited by KuroiLight on 10 Jan 2018, 20:58, edited 2 times in total.
Windows 10, Ryzen 1600, 16GB G.Skill DDR4, 8GB RX 480 | [MyScripts][MySublimeSettings] [Unlicense][MIT License]
guest3456
Posts: 2121
Joined: 09 Oct 2013, 10:31

Re: simplified WinEvents

10 Jan 2018, 20:56

haven't tried it, but looks like nice work


Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 13 guests