Jump to content
Sign in to follow this  
OneManPen

Detect flash status of a program in taskbar

Recommended Posts

OneManPen

I was creating an auto reply script for a chat program called Xfire and was wondering which return value the function WinGetState would return if the chat window was flashing in the task bar or if there was a way to get it if WinGetState didn't support flash detection? Thank you in advance.

Share this post


Link to post
Share on other sites
JohnOne

If the window is using the standard windows API, I imagine you would need to check for Active and Inactive in a loop.

I'm not 100% on that, but a little experimentation should reveal all.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
IanN1990

Heya, I found this code while searching though the forums. It works for steam, but not for msn or skype. So maybe it will work for u, if not maybe u might be able to figure out a way to make it work :D

Opt('WinTitleMatchMode', 2 )

while 1

sleep(250)

;Show Chat Messages

$Steam = WinGetState("- Chat", "")
If  _Flash("- Chat") <> 0 Then
    if BitAnd($Steam, 16) Then
            WinSetState("- Chat","",@SW_RESTORE)
    WinSetOnTop("- Chat", "", 1)
EndIf
EndIf
wend

Func _Flash($win)
    If WinActive($win) Then Return 0
    $tFLASHWINFO = DllStructCreate("uint;hwnd;dword;uint;dword")
    DllStructSetData($tFLASHWINFO, 1, 20)
    DllStructSetData($tFLASHWINFO, 2, WinGetHandle($win))
    $a = DllCall("user32.dll", "int", "FlashWindowEx", "ptr", DllStructGetPtr($tFLASHWINFO))
    Return $a[0]
EndFunc

I think problem "looking at the help file" might be the DLLStructCreate, maybe that format works for steam but needs a different format for msn and skype, but this is just a random guess as it only returns 0 ^^

Edited by IanN1990

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  

×