Jump to content

Dynamic Tray Menu Refresh


 Share

Recommended Posts

Hi,

I have searched the forum far and wide, (well, more far then wide), and have come up with nada. I am wondering if there is a way to dynamically update an item in the tray menu while it is being viewed so as to show the new update. Basically I have a count-down timer inside my tray menu and would like to see changes in that timer as they occur. I do update the item with TrayItemSetText, but it won't show these changes unless I repeatedly click the icon.

Also, in a related issue, is it possible to update the tray tool tip in the same manner, (ie. while the mouse is over the tray icon, the timer in the tray tool tip updates as you view it)?

Thanks in advance for any help anyone can give. I have noticed similar things within AutoIt and have wondered if I am just missing something.

Thanks.

:D

"Intelligence is the ability to adapt to change."                                      - Stephen Hawking                                        "...not the ability to exploit others."                                                  - OldCoder
Link to comment
Share on other sites

You aren't getting help right away because you aren't posting any code. This is from the help file:

#Include  <Constants.au3>
#NoTrayIcon

Opt("TrayAutoPause",0)  ; Script will not be paused when clicking the tray icon.

$valitem    = TrayCreateItem("Val:")
TrayCreateItem("")
$aboutitem  = TrayCreateItem("About")

TraySetState()

TrayItemSetText($TRAY_ITEM_EXIT,"Exit Program")
TrayItemSetText($TRAY_ITEM_PAUSE,"Pause Program")

TrayItemSetText($valitem,"OMFG")
TrayItemSetText($aboutitem,"HOLY CRAP")

;TraySetState()

While 1
    $msg = TrayGetMsg()
    Select
        Case $msg = 0
            ContinueLoop
        Case $msg = $valitem
            TrayItemSetText($valitem,"Val:" & Int(Random(1,10,1)))
        Case $msg = $aboutitem
            Msgbox(64,"about:","AutoIt3-Tray-sample")
    EndSelect
WEnd

Exit

This updates the text of the old menu items.

Link to comment
Share on other sites

Also...This Question Is Fairly Hard...Give People So Time...Then Give It A Nice Bump! Maybe This lil Bump With Help Out With Your Answers @Weapon ;D thats a nice one...@oldcoder...maybe this will help ya :D

Link to comment
Share on other sites

You must be typing a story. Re-reading your post it seems you want something more like this:

#Include <Constants.au3>
#NoTrayIcon

TraySetState()

For $X = 60 to 0 Step -1
    TraySetToolTip($X)
    Sleep(1000)
Next

Only problem is while the mouse is over the icon the text updates are being ignored, correct?

Edited by weaponx
Link to comment
Share on other sites

You aren't getting help right away because you aren't posting any code. This is from the help file:

#Include  <Constants.au3>
#NoTrayIcon

Opt("TrayAutoPause",0)  ; Script will not be paused when clicking the tray icon.

$valitem    = TrayCreateItem("Val:")
TrayCreateItem("")
$aboutitem  = TrayCreateItem("About")

TraySetState()

TrayItemSetText($TRAY_ITEM_EXIT,"Exit Program")
TrayItemSetText($TRAY_ITEM_PAUSE,"Pause Program")

TrayItemSetText($valitem,"OMFG")
TrayItemSetText($aboutitem,"HOLY CRAP")

;TraySetState()

While 1
    $msg = TrayGetMsg()
    Select
        Case $msg = 0
            ContinueLoop
        Case $msg = $valitem
            TrayItemSetText($valitem,"Val:" & Int(Random(1,10,1)))
        Case $msg = $aboutitem
            Msgbox(64,"about:","AutoIt3-Tray-sample")
    EndSelect
WEnd

Exit

Thanks again for your reply. Any help you can give is more then appreciated.

:D

"Intelligence is the ability to adapt to change."                                      - Stephen Hawking                                        "...not the ability to exploit others."                                                  - OldCoder
Link to comment
Share on other sites

Yes, that is correct. Not just the tray tool tips, but the tray item itself is not showing the update. I am lost. :D

"Intelligence is the ability to adapt to change."                                      - Stephen Hawking                                        "...not the ability to exploit others."                                                  - OldCoder
Link to comment
Share on other sites

Also...This Question Is Fairly Hard...Give People So Time...Then Give It A Nice Bump! Maybe This lil Bump With Help Out With Your Answers @Weapon ;D thats a nice one...@oldcoder...maybe this will help ya :P

Thanks Swift, and you are right, I need to have some patience. I was a tad frustrated last year when I had no replies at all to my "TV CARD CONTROL" question and I guess it WAS a hard question.

Thanks again.

Cheers

:D

"Intelligence is the ability to adapt to change."                                      - Stephen Hawking                                        "...not the ability to exploit others."                                                  - OldCoder
Link to comment
Share on other sites

Hehe...dont ya love when the server is slow...so you press "send reply" twice...and it sends the whole post twice? :D

LOL... I do that WAY too often. It goes along with my patience issues. Someone just take my mouse away from me. :P

"Intelligence is the ability to adapt to change."                                      - Stephen Hawking                                        "...not the ability to exploit others."                                                  - OldCoder
Link to comment
Share on other sites

@OldCober ;)

LMAO!! :P

:P Patience Dear One...Patience....... :P

<OldCoder> :P

Haha about the double posting thing...it took forever one time...that i pressed it like 20 times and had to delete like 19 posts :D;):D

Edited by Swift
Link to comment
Share on other sites

@OldCober ;)

LMAO!! :P

:D Patience Dear One...Patience....... :D

<OldCoder> :P

Haha about the double posting thing...it took forever one time...that i pressed it like 20 times and had to delete like 19 posts :P;):D

LMAO... :P sounds like something I would do.

Went and took that color quiz thingy. First time I took it, being a bit self righteous in my answers, but basically turthful, I was blue, the enmy of red. Then I took it again, most of the answers were the same, but I was much more truthful and it came out red. LOL. Goes to show you....you can never let anyone tell you who you are... they don't even know who they are. ;)

"Intelligence is the ability to adapt to change."                                      - Stephen Hawking                                        "...not the ability to exploit others."                                                  - OldCoder
Link to comment
Share on other sites

  • 1 month later...

Did you get anywhere with this? I think the problem lies in the fact that AutoIt pauses while you have a tray menu open.

Yeah. I appreciate the help. I've decided that the problem is above my pay-grade and must admit to defeat. On the other hand, simulating a tray menu is far more feasible and offers a great deal more options and flexibility. This is the way I am going with this now, though it has been a tad problematic, I am sure I'll be able to work out the bugs.

Thanks again & cheers.

:)

"Intelligence is the ability to adapt to change."                                      - Stephen Hawking                                        "...not the ability to exploit others."                                                  - OldCoder
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...