Code: Select all
#Persistent
#SingleInstance force
Menu, Tray, NoStandard
Menu, Tray, Add, Section 1, Section1
Menu, Tray, Add, Section 2, Section2
Menu, Tray, Add,
Menu, Tray, Add, Exit, Exit
Return
Section1:
If (Section1 = 1)
{
Menu, Tray, Uncheck, Section 1
Section1 = 2
}
Else
{
Menu, Tray, Check, Section 1
Menu, Tray, Uncheck, Section 2
Section1 = 1
Section2 = 2
}
Return
Section2:
If (Section2 = 1)
{
Menu, Tray, Uncheck, Section 2
Section2 = 2
}
Else
{
Menu, Tray, Uncheck, Section 1
Menu, Tray, Check, Section 2
Section1 = 2
Section2 = 1
}
Return
Exit:
ExitApp
#If (Section1 = 1) && WinActive("ahk_exe NOTEPAD.EXE")
$F1::
Msgbox, Hello Section One
Return
#If (Section2 = 1) && WinActive("ahk_exe NOTEPAD.EXE")
$F1::
Msgbox, Hello Section Two
Return