Sign in to follow this  
Followers 0
lottafreetime22

Tray Menu not working -- i did follow the example

2 posts in this topic

I tried to create a tray menu for my program using the following code, but it doesn't show up ... just the default pause / exit one...

TrayItemSetOnEvent(TrayCreateItem("Settings"), "SettingsDialog")
    TrayItemSetOnEvent(TrayCreateItem("Go there now"), "VisitSite")
    TrayCreateItem("")
    TrayItemSetOnEvent(TrayCreateItem("Uninstall"), "Uninstall")
    TrayCreateItem("")
    TrayItemSetOnEvent(TrayCreateItem("About"), "AboutDialog")
    TrayItemSetOnEvent(TrayCreateItem("Exit"), "Close")
    TraySetState()

i'm probably making some common error, could somebody help me figure out what it is?

Share this post


Link to post
Share on other sites



You didn't list your entire code but this example using your code works for me (on XP SP1).

#include <GUIConstants.au3>
#NoTrayIcon
Opt("TrayOnEventMode",1)
Opt("TrayMenuMode",1)   ; Default tray menu items 

TrayItemSetOnEvent(TrayCreateItem("Settings"), "SettingsDialog")
TrayItemSetOnEvent(TrayCreateItem("Go there now"), "VisitSite")
TrayCreateItem("")
TrayItemSetOnEvent(TrayCreateItem("Uninstall"), "Uninstall")
TrayCreateItem("")
TrayItemSetOnEvent(TrayCreateItem("About"), "AboutDialog")
TrayItemSetOnEvent(TrayCreateItem("Exit"), "Close")
TraySetState()
   
GUICreate("Gui", 300, 100)

GUISetState () ; show form
   
While 1
    $msg = GUIGetMsg()

    Switch $msg
        Case $GUI_EVENT_CLOSE; exit
            Exit

    EndSwitch
    
WEnd

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