Sign in to follow this  
Followers 0
Angel

How to always hide the tray icon of an external program

4 posts in this topic

Hi,

is there any way to always hide the tray icon of an external program? What I want to achieve is the same as if I manually opened the "Taskbar and Start Menu Properties", when to "Customize...", selected a certain program and made it "Always hide".

Normally you can do this manually and windows always remembers that settings, but there is an exception: Visual Studio 2005 macros.

I have made some Visual Studio macros to automate tasks in Visual Studio 2005. Every time that a macro is running an icon appears on the system tray, showing that a "macro is running". This is very annoying because some of my macros execute every time that a breakpoint is hit in visual studio, so the icon keeps appearing and disappearing from the system tray.

For some reason, if I disable the icon, it will remain disabled only until the next time that I start visual studio. It seems that visual studio deletes the "Always hide" setting to ensure that when a macro is running you always get that system tray icon.

Is there any way to work around that?

Help would be much appreciated! Thanks,

Angel

Share this post


Link to post
Share on other sites



Hi,

Look at SysTray_UDF here.


 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

MsCreatoR,

thanks for the answer. I tried it but it does not work.

What these functions do is hide an existing system tray icon. But if the application puts the icon in the system tray again, then it will appear again on the system try.

In my case, visual studio puts the icon on the system tray _every time_ that a visual studio macro is executed. So even if I remove the icon (by means of _SysTrayIconRemove), the icon will re-appear again later, which is exactly what I want to avoid.

I've found some information on the internet about how windows keeps the info about which icons to show and hide in the registry. It appears that there are two registry keys involved:

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\TrayNotify\IconStreams

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\TrayNotify\LastIconStreams

These are REG_BINARY keys, and are very big. I tried to read them with RegRead from autoit but it fails. It gives and error code -2: "value type not supported" but the help file says that AutoIt supports REG_BINARY.

May this be because their values are too big?

What I think that must be done is to somehow change those values so that we can permanently hide the icons. My guess is that visual studio resets that value when it exits (or when it starts) to ensure that the macros tray icon is always shown.

So the question seems to be: How can I read and modify those registry values? Any ideas?

Angel

Share this post


Link to post
Share on other sites

Size of a general string buffer is limited by 4095 kb.

I think here is the problem... but why RegRead set @error = -2 ?


 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0