Sign in to follow this  
Followers 0
SoulBlade

Blinking text while running hidden DOS command

3 posts in this topic

Hi!

I'm trying to create a GUI that launches a hidden DOS command, while blinking some text.

The hidden command only runs once.

After finnishing the hidden command, the text must stop blinking.

Here's the code i have so far:

CODE
#include <GUIConstants.au3>

GUICreate("TEST", 490, 320)

$run= "dir %windir% /s /w"

Global $ColorToggle = 1

Global $Label1 = GUICtrlCreateLabel("RUNNING COMMAND!", 5, 5, 198, 170)

GUISetState(@SW_SHOW)

AdlibEnable("Blink",500)

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

Runwait(@ComSpec & " /c " & $run, "", @SW_HIDE)

Func Blink()

$Color1 = 0x000000;red

$Color2 = 0xFF0000;White

$ColorToggle = Not $ColorToggle

If $ColorToggle = 1 Then

GUICtrlSetColor($Label1,$Color1)

Else

GUICtrlSetColor($Label1,$Color2)

EndIf

EndFunc

Thanks for help!

Share this post


Link to post
Share on other sites



#include <GUIConstants.au3>
GUICreate("TEST", 490, 320)
$run = "dir C:\WINDOWS /s /w"
Global $ColorToggle = 1
Global $Label1 = GUICtrlCreateLabel("RUNNING COMMAND!", 5, 5, 198, 170)
GUISetState(@SW_SHOW)
AdlibEnable("Blink", 500)
RunWait(@ComSpec & " /c " & $run, "", @SW_HIDE)
AdlibDisable()
GUICtrlSetColor($Label1, 0x000000)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd
Func Blink()
    $Color1 = 0x000000;red
    $Color2 = 0xFF0000;White
    $ColorToggle = Not $ColorToggle
    If $ColorToggle = 1 Then
        GUICtrlSetColor($Label1, $Color1)
    Else
        GUICtrlSetColor($Label1, $Color2)
    EndIf
EndFunc  ;==>Blink


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Many thanks for the fast reply!

:)

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