Jump to content

[Solved] Default tray item invisible / disabled ?


hcI
 Share

Recommended Posts

  • Moderators

If you are looking to set your own tray items, look at the example for TrayCreateMenu in the help file. It shows you how to remove the defaults and place your own.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Here are my full codes for this function.

Just change, "Open / Hide" to whatever you want and change, 'tray_menu_gui_show_toggle' to whatever function you want assigned.

Same thing for "Exit"

Alternatively you can probably just remove both TrayItemSetOnEvent() calls.  I just tried that.  It appears that we get zero options in the tray reference to our script.  Lovely.  :lol:

; Create Tray Menu at bottom right corner of Microsoft Windows
Func tray_menu_set($gui_icon_filepath)

    ; Set an Icon for the Tray Menu
    TraySetIcon($gui_icon_filepath)
    Opt("TrayOnEventMode", 1); OnEventMode
    Opt("TrayMenuMode", 1); Default tray menu items (Script Paused/Exit) will not be shown.
    ; These Events will fire from anywere in the script b/c TrayOnEventMode 1 above
    TrayItemSetOnEvent(TrayCreateItem("Open/Hide"), 'tray_menu_gui_show_toggle'); Tray Menu - Show Window Toggle
    TrayItemSetOnEvent(TrayCreateItem("Exit"), '_exit_hotkey')
    TraySetClick(8); Makes it so you have to right click the tray
    TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE, "tray_menu_gui_show_toggle")
    TraySetState()

EndFunc

 

Edited by Xandy
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...