Sign in to follow this  
Followers 0
wrybread

change icon during program execution?

3 posts in this topic

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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

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