Adding Options to the System tray icon Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
sporefreak
Posts: 21
Joined: 23 Dec 2015, 02:38

Adding Options to the System tray icon

22 Jun 2017, 01:06

When you right click the system tray icon it gives a bunch of options, I want to know if its possible to add some
Image
This would make my scripts a lot more powerful and useful than before.
Can this be done? any google searches led to changing the icon picture itself which is not what I want.
TAC109
Posts: 1112
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Adding Options to the System tray icon

22 Jun 2017, 01:16

Look at the menu command.
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
robmar-zl
Posts: 24
Joined: 05 Feb 2015, 04:57

Re: Adding Options to the System tray icon  Topic is solved

22 Jun 2017, 01:39

Quick and dirty

Code: Select all

#NoEnv
#Persistent

;------------------------------------------------------------------------------
; SET TRAY-MENU
;------------------------------------------------------------------------------
Menu, Tray, Standard
;Menu, Tray, NoStandard ; to remove default menu
Menu, Tray, Add
Menu, Tray, Add, Run startup, startup
Menu, Tray, Add, Launch Settings Gui, settings 
Menu, Tray, Add
Menu, Tray, Add, Close, CloseGui
Menu, Tray, Click, 1
Menu, Tray, Tip, Your program description

return

startup:
	msgbox, startup
return

settings:
	msgbox, settings
return

CloseGui:
	ExitApp
return
User avatar
sporefreak
Posts: 21
Joined: 23 Dec 2015, 02:38

Re: Adding Options to the System tray icon

22 Jun 2017, 11:49

So I guess I dont understand why #Persistent is there?
I did test it with and without it and the script seemed to work fine.
Is there a reason its there or is it just preference


robmar-zl wrote:Quick and dirty

Code: Select all

#NoEnv
#Persistent

;------------------------------------------------------------------------------
; SET TRAY-MENU
;------------------------------------------------------------------------------
Menu, Tray, Standard
;Menu, Tray, NoStandard ; to remove default menu
Menu, Tray, Add
Menu, Tray, Add, Run startup, startup
Menu, Tray, Add, Launch Settings Gui, settings 
Menu, Tray, Add
Menu, Tray, Add, Close, CloseGui
Menu, Tray, Click, 1
Menu, Tray, Tip, Your program description

return

startup:
	msgbox, startup
return

settings:
	msgbox, settings
return

CloseGui:
	ExitApp
return
robmar-zl
Posts: 24
Joined: 05 Feb 2015, 04:57

Re: Adding Options to the System tray icon

23 Jun 2017, 00:07

I'm using Windows 10 and without #Persistent the script keeps not running. You don't need it in Windows 7, XP or any other version.
User avatar
sporefreak
Posts: 21
Joined: 23 Dec 2015, 02:38

Re: Adding Options to the System tray icon

29 Jun 2017, 19:36

robmar-zl wrote:I'm using Windows 10 and without #Persistent the script keeps not running. You don't need it in Windows 7, XP or any other version.
Thats odd, I dont use it and it still works fine

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Endion, Insanibaccha, mikeyww, PsysimSV, uchihito and 206 guests