Removing the tray icon (completely) Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
UserNameForAH_Board
Posts: 50
Joined: 02 Jan 2018, 15:55

Removing the tray icon (completely)

Post by UserNameForAH_Board » 06 Jul 2022, 12:46

Could someone tell me how, in v2, to remove a tray icon? My old code has A_TrayMenu.NoIcon, which no longer works. Thank you. (I've looked at documentation but to no avail.) I won't be needing to restore the icon (but I do want there to be a tray icon, earlier in the program's runtime).


UserNameForAH_Board
Posts: 50
Joined: 02 Jan 2018, 15:55

Re: Removing the tray icon (completely)

Post by UserNameForAH_Board » 06 Jul 2022, 13:34

@TheArkive

I did write: 'but I do want there to be a tray icon, earlier in the program's runtime'. I presume I cannot simply insert #NoTrayIcon as a command. Indeed, the page that you linked says: 'specifying this anywhere in a script will prevent the showing of a tray icon for that script when it is launched'.

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Removing the tray icon (completely)  Topic is solved

Post by swagfag » 06 Jul 2022, 14:08

Code: Select all

A_IconHidden := true

UserNameForAH_Board
Posts: 50
Joined: 02 Jan 2018, 15:55

Re: Removing the tray icon (completely)

Post by UserNameForAH_Board » 06 Jul 2022, 15:29

swagfag: thank you! That seems to do the trick.

@TheArkive: I suppose the 'completely' in my post title might have misled you. Sorry!

User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Removing the tray icon (completely)

Post by TheArkive » 06 Jul 2022, 22:00

@UserNameForAH_Board
No worries. I suppose you were trying to toggle the tray icon programatically? That's what it looks like anyway.

UserNameForAH_Board
Posts: 50
Joined: 02 Jan 2018, 15:55

Re: Removing the tray icon (completely)

Post by UserNameForAH_Board » 07 Jul 2022, 04:40

TharArkive: I was trying to remove the tray icon - one I'd set earlier - immediately before my (compiled) AHK program exited. For, I have found in the past that otherwise the icon can remain - after program exit - until the tray is redrawn.

Post Reply

Return to “Ask for Help (v2)”