Jump to content

detect taskbar window flashing


 Share

Recommended Posts

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.

Link to comment
Share on other sites

  • 1 month later...

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

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