Sign in to follow this  
Followers 0
monte

flash tray icon

3 posts in this topic

Hello, I'm having trouble flashing the tray icon during a custom function. The problem is that I can't get the icon to STOP flashing. Any help would be greatly appreciated, thanks.

#include <IE.au3>
#Include <Constants.au3>
#NoTrayIcon

;;;;;;;;;
;hotkeys
;;;;;;;;;
HotKeySet("^#b", "cmd")       ;cmd prompt

;;;;;;
;tray
;;;;;;
Opt("TrayMenuMode",1)
$cmd   = TrayCreateItem("CMD  - Ctrl Win B")
TrayCreateItem("")
$exititem      = TrayCreateItem("Exit")

TraySetState()
TraySetToolTip("Hotkeys")



While 1
  $msg = TrayGetMsg()
  Select
    Case $msg = 0
      ContinueLoop
    Case $msg = $exititem
      ExitLoop
    Case $msg = $cmd
      cmd()
  EndSelect
WEnd


;;;;;;
;CMD
;;;;;;
func cmd()
  msgbox (0, "Hotkeys", "flashing the system tray icon")
  TraySetState(4)
  msgbox(0, "Hotkeys", "Running cmd.exe and blah, blah, blah")
  Run(@ComSpec & " /k color 02&prompt #&cls" & @cr)
 ; other code goes here...
  sleep (5000)
  msgbox(0, "Hotkeys", "stopping the flashing system tray icon")
  TraySetState()

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;
 ;I've also tried TraySetState(16) AND TraySetState(8) at this point -- NO LUCK
 ;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
endfunc

Share this post


Link to post
Share on other sites

But... I used TraySetState(8) and it worked :)

Share this post


Link to post
Share on other sites

But... I used TraySetState(8) and it worked :)

traysetstate(8) is working for me now....darn those gremlins!

thanks!

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