React to tray-icon pause script event

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
autocart
Posts: 214
Joined: 12 May 2014, 07:42

React to tray-icon pause script event

12 May 2014, 07:45

Hi all,

My script registers a ShellHook. When the user selects "pause script" from the tray icon right click menu then the shell hook (obviously) still stays active.

I was wondering if there is a OnPause event similar to OnExit, so that I can deactivate the hook before the script pauses.
Of course I would have to somehow activate it again with a OnResumefromPause event.
Unfortunately I could not find anything like that. Is this already possible?

Best regards, Stephan
User avatar
SKAN
Posts: 1551
Joined: 29 Sep 2013, 16:58

Re: React to tray-icon pause script event

12 May 2014, 11:05

autocart wrote:deactivate the hook before the script pauses
Alternately, you can test built-in variable A_IsPaused within ShellHook() procedure and act accordingly.
My Scripts and Functions: V1  V2
autocart
Posts: 214
Joined: 12 May 2014, 07:42

Re: React to tray-icon pause script event

13 May 2014, 00:18

SKAN wrote:you can test built-in variable A_IsPaused within ShellHook() procedure and act accordingly.
Very good thought. Thank you, SKAN!

I had already tried to use the Menu command with NoStandard and then build my own menu entries. But I like your idea even better.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], peter_ahk and 349 guests