Sign in to follow this  
Followers 0
St4inL3ss

detect taskbar window flashing

4 posts in this topic

there is a function WinFlash to make a taskbar window flash. But, is there a way to detect if something flashes in the taskbar?

Share this post


Link to post
Share on other sites



I think you would have to monitor color changes with PixelGetColor.

Another idea would be to hook the appropriate windows API but that would have to be done with a C dll or similar.

No, take a lok at PixelGetColor and see if you can sort it out.

Share this post


Link to post
Share on other sites

i was hoping there was a simpler method for this, but thanks anyway ;)

Share this post


Link to post
Share on other sites

i was hoping there was a simpler method for this, but thanks anyway :D

yes, a simple method exists :P

:) There is de "main code":

Opt("WinTitleMatchMode", 2); 1=start, 2=subStr, 3=exact, 4=advanced
HotKeySet("^!{F12}", "Done")        ; Exit Script = Ctrl + Alt + F12
;
;
While 1

;   Find a pure blue pixel within 10 shades variations of pure blue, skipping over 10 pixels (for speed). 
    $coord = PixelSearch( 0, @DesktopHeight-30, @DesktopWidth, @DesktopHeight, 0x0A246A, 10, 10 )
;                |__ See "PixelSearch" Function Reference
;                |__ The Pixel-Search is over the TaskBar zone. The Screen resolution? no matters...[/i] 

; If pixel change blue, click on window-flash coordinates
    If Not @error Then
          ;MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])
        MouseClick("left", $coord[0], $coord[1],1,0)    
    EndIf
    
; Wait for the region to change, the region is checked every 100ms to reduce CPU load   
    Sleep (100)

WEnd
;
;
;
Func Done()
    Exit 0
EndFunc
  • For test intention there is anoter two scripts, for "notepad" and "calc" windows flashing, that you must to execute
  • Execute first the "main code", then run these two scripts, and you see...
:D Flashing Notepad

Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced

If NOT WinExists("- Bloc de notas") Then
    Run("Notepad.exe", "", @SW_MINIMIZE)
EndIf

While NOT WinExists("- Bloc de notas") 

Wend

; flashes the window 4 times with a break in between each one of 1/2 second
    WinFlash('- Bloc de notas',"", 4, 500)

:D Flashing Calculator

Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced

    If NOT WinExists("Calculadora") Then
        RunWait("Calc.exe", "", @SW_MINIMIZE)
        WinSetState("Calculadora", "", @SW_MINIMIZE)
    EndIf

; flashes the window 4 times with a break in between each one of 1/2 second
    WinFlash("Calculadora","", 4, 500)

That's all, folks! :P

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