hide a specific tray icon on demand

Get help with using AutoHotkey and its commands and hotkeys
Posts: 1
Joined: 03 Dec 2020, 20:23

hide a specific tray icon on demand

Post by dokimi » 03 Dec 2020, 20:50

hello I want to hide the icon of a specific program on demand from the tray bar.
I found 2 programs that can make the job done but they need registration and unessecery for a simple task taskbar hide, PS Tray Factory.
After alot of search I found this library that has TrayIcon_Hide function but I really don't understand how it works and I cant make it work any help will be apriciated.
I want a solution similar to
TrayIcon_Hide ("ahk.exe")

User avatar
Posts: 1651
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: hide a specific tray icon on demand

Post by JoeWinograd » 03 Dec 2020, 22:50

This shows you how to do it. Incorporate it into your code however you want. Regards, Joe

Code: Select all

WhichTray:=1 ; 0==>NotifyIconOverflowWindow (overflow tray)  1==>Shell_TrayWnd (main tray)
TrayIcon_Hide(ProgIDcmd,WhichTray,True) ; this hides it
MsgBox,4160,Now Hidden,%ProgTooltip%
TrayIcon_Hide(ProgIDcmd,WhichTray,False) ; this shows it
MsgBox,4160,Now Shown,%ProgTooltip%
#Include TrayIconLibrary.ahk ; put your Include statement here

Post Reply

Return to “Ask For Help”