Sign in to follow this  
Followers 0
Lemures

Rebuild tray menu

4 posts in this topic

I have a point in my script where the options in the tray need to change. How do I simply destroy what I have populating the tray and rebuild it?

Share this post


Link to post
Share on other sites



just changed a few lines from the help file

#Include <Constants.au3>
#NoTrayIcon

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


$aboutitem        = TrayCreateItem("Create")
TrayCreateItem("")
$exititem        = TrayCreateItem("Exit")
TrayCreateItem("")
$delitem        = TrayCreateItem("Delete")


TraySetState()

While 1
    $msg = TrayGetMsg()
    Select
        Case $msg = 0
            ContinueLoop
        Case $msg = $aboutitem
            If $delitem = "" Then
                $delitem        = TrayCreateItem("Delete")
            EndIf
        Case $msg = $delitem
            If $delitem <> "" Then
            TrayItemDelete($delitem)
            $delitem = ""
            EndIf
        Case $msg = $exititem
            ExitLoop
    EndSelect
WEnd

Exit

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

That only deletes what I choose though, I need to delete EVERYTHING. Is there a way to get a list of tray_ids so that I can just do a little loop to delete them all?

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