hcI

[Solved] Default tray item invisible / disabled ?

6 posts in this topic

#1 ·  Posted (edited)

The title says all. How can i disable default items (  Script Paused, Exit ) of the tray menu and set only mine if possible ?

Edited by hcI
Solved

Share this post


Link to post
Share on other sites



#2 ·  Posted

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.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted

TrayCreateMenu ( "sub/menutext" [, menuID = -1 [, menuentry = -1]] )

 I looked out the help but i don't understand how can i disable the others ones

Share this post


Link to post
Share on other sites

#4 ·  Posted

Try, 

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


I am not a lawyer.  (-_-) Xandy About  (^o^) Discord - Xandy Programmer

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

I am not a lawyer.  (-_-) Xandy About  (^o^) Discord - Xandy Programmer

Share this post


Link to post
Share on other sites

#6 ·  Posted

Thanks you !

It works nice, have a nice day !

1 person likes this

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