Jump to content

Set systray icon to "Always Show"?


rotamo
 Share

Recommended Posts

I've tried to find how to set this with no luck. This is for a HotKey program and it also contains a menu that shows users the HotKey combo as well as the ability to launch the function from the menu. As such, I'd like to keep the program's icon always showing in the system tray automatically. As always, any insight is always appreciated.

Link to comment
Share on other sites

I've tried to find how to set this with no luck. This is for a HotKey program and it also contains a menu that shows users the HotKey combo as well as the ability to launch the function from the menu. As such, I'd like to keep the program's icon always showing in the system tray automatically. As always, any insight is always appreciated.

I thought the icon always showed unless you set it to be hidden with the TrayIconHide option. Can you give an example script?
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I thought the icon always showed unless you set it to be hidden with the TrayIconHide option. Can you give an example script?

It's set by the users settings for >Taskbar>>Properties>Hide Inactive icons>> customize.

Someplace in Example Scripts is a SysTray UDF that I think will handle what he needs.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

I thought the icon always showed unless you set it to be hidden with the TrayIconHide option. Can you give an example script?

You're right, and I'm aware of the TrayIconHide option. It will show until the system considers it as "Inactive" and then it becomes hidden automatically after a period of inactivity. I don't show the icon until after password entry (the HotKey profile used depends on a password), then show it along with a ToolTip to show which profile is logged in. But again, with inactivity it will hide on its own. Some very stripped down code:

Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown.
TraySetState(2);hides tray icon

;prompt for password
;depending on password, enable particular set of HotKeys for that group

TraySetState(1);shows tray icon
TraySetToolTip("Company HotKeys 1.0.19 - Customer Service Profile");in this case Customer Service is signed in

It's set by the users settings for >Taskbar>>Properties>Hide Inactive icons>> customize.

Unfortunately, most of my users won't think to do that, and I want to avoid the inevitable call, "Where's my HotKeys menu?!?!?" if I can.

Someplace in Example Scripts is a SysTray UDF that I think will handle what he needs.

Looked for this but couldn't locate. Found a lot of references to regedit online which I'll explore, however for the initial release, I think I'll just throw in a refresh on a timer unless someone has any other ideas... Edited by rotamo
Link to comment
Share on other sites

You're right, and I'm aware of the TrayIconHide option. It will show until the system considers it as "Inactive" and then it becomes hidden automatically after a period of inactivity. I don't show the icon until after password entry (the HotKey profile used depends on a password), then show it along with a ToolTip to show which profile is logged in. But again, with inactivity it will hide on its own. Some very stripped down code:

Opt("TrayMenuMode",1); Default tray menu items (Script Paused/Exit) will not be shown.
TraySetState(2);hides tray icon

;prompt for password
;depending on password, enable particular set of HotKeys for that group

TraySetState(1);shows tray icon
TraySetToolTip("Company HotKeys 1.0.19 - Customer Service Profile");in this case Customer Service is signed in

Unfortunately, most of my users won't think to do that, and I want to avoid the inevitable call, "Where's my HotKeys menu?!?!?" if I can.

Looked for this but couldn't locate. Found a lot of references to regedit online which I'll explore, however for the initial release, I think I'll just throw in a refresh on a timer unless someone has any other ideas...

Must have missed this one

SysTray_UDF

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Must have missed this one

SysTray_UDF

I did indeed. Thanks. I guess I'm still missing something. From what I gathered, there isn't anything specific that sets the system setting to "Always Show" as when you do it manually from the Taskbar and Start Menu Properties > Customize, but I'll keep digging. Whatever solution I put in place will need to wait until the next release anyway, so no hurry. Your guidance is much appreciated.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...