IanN1990 Posted November 28, 2011 Share Posted November 28, 2011 (edited) Heya, I am a little confused at why this is not working. for "- Chat", if someone messages me on steam it restores the steam-chat window "as i have no-taskbar" but for MSN and skype, though the flash disappears it doesn't restore the chat windows. Would anyone have any idea why? Opt('WinTitleMatchMode', 2 ) while 1 If _Flash("- Chat") <> 0 Then WinSetState("- Chat","",@SW_RESTORE) ElseIf _Flash("[Class:TConversationForm]") <> 0 Then WinSetState("[TConversationForm]","",@SW_RESTORE) elseif _Flash("[Class:IMWindowClass]") <> 0 Then WinSetState("[Class:IMWindowClass]","",@SW_RESTORE) EndIf Sleep(100) 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 use Opt('WinTitleMatchMode', 2 ) WinFlash("[Class:IMWindowClass]","", 2, 1) WinFlash("[Class:TConversationForm]","", 2, 1) WinFlash("- Chat","", 2, 1) for making them flash for testing Edited April 14, 2012 by IanN1990 Link to comment Share on other sites More sharing options...
martin Posted November 28, 2011 Share Posted November 28, 2011 Why not try WinActivate? Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
guinness Posted November 28, 2011 Share Posted November 28, 2011 In addition to what martin said FlashWindowEx is already included in WinAPI.au3 >> _WinAPI_FlashWindowEx. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
IanN1990 Posted November 28, 2011 Author Share Posted November 28, 2011 (edited) @Martin i changed the code to include WinActivate but it has the same effect. the _Flash detects the flash is happened, the if_flash runs because msn and skype loses their "flash" but they dont open. Whereas steam does, so the code does work but its just not working for msn or skype for some reason Opt('WinTitleMatchMode', 2 ) ;Run Loop while 1 Sleep(100) ;Check if steam is flashing If _Flash("- Chat") <> 0 Then ;Open steam chat window WinSetState("- Chat","",@SW_RESTORE) ;Check if skype is flashing ElseIf _Flash("[Class:TConversationForm]") <> 0 Then ;Open Skype chat window WinActivate("[Class:TConversationForm]") ;Check if msn is flashing elseif _Flash("[Class:IMWindowClass]") <> 0 Then ;Open msn chat window WinActivate("[Class:IMWindowClass]") EndIf WEnd ;Detects if flashing 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 @Guinness i looked at the help file for that API, and from what i can gather its used to flash a window in a non-active way? I am not too sure how i would use this to check if a window is flashing and then show that program. Edited November 28, 2011 by IanN1990 Link to comment Share on other sites More sharing options...
guinness Posted November 28, 2011 Share Posted November 28, 2011 (edited) What I meant was you're calling the API incorrectly and should opt for using _WinAPI_FlashWindowEx >>Func _Flash($hWnd) If WinActive($hWnd) Then Return 0 EndIf Return _WinAPI_FlashWindowEx($hWnd) EndFunc ;==>_FlashMSDN Ref: FlashWindowEx Edited November 28, 2011 by guinness UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
IanN1990 Posted November 28, 2011 Author Share Posted November 28, 2011 (edited) Yea i really dont know lol, spent the last 50mins going though ur code, my code and the help fine with little success *Edit Was the original Post i found that started me on this codeI cant understand why it would work for steam, and not for msn or skype Edited November 28, 2011 by IanN1990 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now