Sign in to follow this  
Followers 0
LiquidPerceptions

Blinking Tray Icon

7 posts in this topic

I'd like to have my program actiavte a blinking / animated tray icon while it is in the middle of a process / function. When I wrote what I had however, it just crashed as a buffer overflow. I could include a sleep() to stop that, but I'm trying to run a process, and then activate the blink while that function is still running. My script is simple, I want to copy a directory from one drive to another. This directory is nearly 6GB in size though, so while the CopyFile is running, I'd like to have the icon blink or animate. Anyone have any ideas? I searched through the forums, and couldn't find much.


"I'm not here to make decisions, I'm here to make a difference"

Share this post


Link to post
Share on other sites



straight from help

TraySetState ( [ flag ] )

Parameters

flag [optional]

A combination of the following:

1 = Shows the tray icon (default)

2 = Destroys/Hides the tray icon

4 = Flashes the tray icon

8 = Stops tray icon flashing

16 = Resets the icon to the defaults (no flashing, default tip text)

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

straight from help

TraySetState ( [ flag ] )

Parameters

flag [optional]

A combination of the following:

1 = Shows the tray icon (default)

2 = Destroys/Hides the tray icon

4 = Flashes the tray icon

8 = Stops tray icon flashing

16 = Resets the icon to the defaults (no flashing, default tip text)

8)

Ha ha.. I don't know why, but I totally missed that in the remarks.. Thanks!

"I'm not here to make decisions, I'm here to make a difference"

Share this post


Link to post
Share on other sites

Is there a way to truely do annimated icons? Lots of programs have them... basically, I want my icon to spin when a certain function is running. Its not the end all be all, but it would be a nice addition. Possible in autoit?

LD

Share this post


Link to post
Share on other sites

Is there a way to truely do annimated icons? Lots of programs have them... basically, I want my icon to spin when a certain function is running. Its not the end all be all, but it would be a nice addition. Possible in autoit?

LD

Me too. Possible?

Share this post


Link to post
Share on other sites

LondonNDIB

Zomp

Example without AdlibEnable() function:

#include <GuiConstants.au3>

Opt("TrayIconHide", 1)

Global $Animate = False
Global $count = 1
Global $begin = 0

Opt("TrayMenuMode", 1)

GUICreate("Test GUI", 200, 100)

$hButton = GUICtrlCreateButton("Start", 70, 40, 60, 25)

TraySetIcon("metroid\met1.ico")

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $hButton
            If GUICtrlRead($hButton) = "Start" Then
                GUICtrlSetData($hButton, "Stop")
                $Animate = True
                $begin = TimerInit()
            Else
                GUICtrlSetData($hButton, "Start")
                $Animate = False
                TraySetIcon("metroid\met1.ico")
            EndIf
    EndSwitch
    
    If $Animate = False Then ContinueLoop
    
    If TimerDiff($begin) >= 250 Then
        If $count = 4 Then $count = 1
        TraySetIcon("metroid\met" & $count & ".ico")
        $count += 1
        $begin = TimerInit()
    EndIf
WEnd

Folder with icons must be in script directory.

metroid.zip

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