Jump to content

flash tray icon


monte
 Share

Recommended Posts

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
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...