Script ON|OFF with Tooltips Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
dammtools
Posts: 12
Joined: 11 Oct 2015, 18:02

Script ON|OFF with Tooltips

03 Jul 2018, 06:19

Hi.

I have a script which is turned ON|OFF by pressing the Left Control and NumpadSub (minus key in numpad), like this:

Code: Select all

<^NumpadSub:: toggle := !toggle
Is there a way to make the script show a Tooltip that shows the script is activated or deactivated every time I press these keys?

TY in advance!
User avatar
jmeneses
Posts: 524
Joined: 28 Oct 2014, 11:09
Location: Catalan Republic

Re: Script ON|OFF with Tooltips  Topic is solved

03 Jul 2018, 06:43

Hello dammtools, try this

Code: Select all

#NoEnv 
#SingleInstance force 
#Persistent   

trayIconON  := "C:\Temp\On.ico"
trayIconOFF := "C:\Temp\Off.ico"
Menu,Tray,Icon, % trayIconON ,,1
Menu,Tray,Tip,  % "State ON"
Return 

<^NumpadSub::
toggle := !toggle
Menu, Tray, Tip,  % toggle ? "State OFF" : "State ON"
Menu, Tray, Icon, % toggle ? trayIconOFF : trayIconON, 1
ToolTip % toggle ? "State OFF" : "State ON"
SetTimer, RemoveToolTip, 1000
return

RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return

EDIT: Add ToolTip
Donec Perficiam
dammtools
Posts: 12
Joined: 11 Oct 2015, 18:02

Re: Script ON|OFF with Tooltips

03 Jul 2018, 07:40

That's exactly what I needed.

Thank you, Sir!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], peter_ahk and 358 guests