Jump to content

change icon during program execution?


wrybread
 Share

Recommended Posts

I'm trying to change the icon in the System Tray of the script I'm running. In other words, if a given condition is met, the icon changes to something else.

Is this possible?

I've searched the archives and didn't come up with anything.

Link to comment
Share on other sites

Strait from the help file ;)

#Include <Constants.au3>
#NoTrayIcon

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

$exititem      = TrayCreateItem("Exit")

TraySetState()

$start = 0
While 1
    $msg = TrayGetMsg()
    If $msg = $exititem Then ExitLoop
    $diff = TimerDiff($start)
    If $diff > 1000 Then
        TraySetIcon("Shell32.dll",Random(0,100,1))
        $start = TimerInit()
    EndIF
WEnd

Exit
Link to comment
Share on other sites

  • 1 year later...

Hi

This may help you

$Icon = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer")

If $Icon ="fred:80" Then

TraySetIcon (@ScriptDir & "\Icons\firewall.ico")

Else

TraySetIcon (@ScriptDir & "\Icons\freep.ico")

Endif

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