Sign in to follow this  
Followers 0
OneManPen

Detect flash status of a program in taskbar

3 posts in this topic

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



#3 ·  Posted (edited)

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  
Followers 0