cyanidemonkey Posted February 28, 2008 Share Posted February 28, 2008 How do I detect a error window when it is triggered and takes priority (won't let you click or interface with main app). The error window comes from Windows Media Player Object, not from my AutoIt code. I have a autoit media player (using Window Media Player backend). I am error testing it. I add a currupt file to the media library and load it and attempt to run it to see how the app handles it. The WMP error window pops up saying it is not the right file type etc. When it does, the autoit app seems to stop/wait for response. I am unable to detect the window, I have tried WinExsist, WinActive etc. none of which work because as soon as the error window appears, the checker script is paused? I'd prefer to detect the error message window, log the currupt file and close the error window and so on (it's an automation software). My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator Link to comment Share on other sites More sharing options...
FreeFry Posted February 28, 2008 Share Posted February 28, 2008 I'm not sure if Adlib will work in a case like this, perhaps you need to do com error handling using ObjEvent? Read in the helpfile regarding the Com/Obj reference about it. Link to comment Share on other sites More sharing options...
cyanidemonkey Posted February 28, 2008 Author Share Posted February 28, 2008 ok, thanks, will do. My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator Link to comment Share on other sites More sharing options...
FreeFry Posted February 28, 2008 Share Posted February 28, 2008 Greatest of luck. Link to comment Share on other sites More sharing options...
rasim Posted February 28, 2008 Share Posted February 28, 2008 cyanidemonkeyMayb this?HotKeySet("{Pause}", "_Exit") Dim $title = "Проигрыватель Windows Media" ;Change title to needing to you :) Dim $TimerProc $DllHandle = DllCallbackRegister("_CheckWindow", "int", "") $TimerProc = DllCall("user32.dll", "int", "SetTimer", "hwnd", 0, "int", 0, "int", 1000, "ptr", DllCallbackGetPtr($DllHandle)) While 1 Sleep(100) WEnd Func _CheckWindow() If WinExists("[Title:" & $title & "; Class:#32770]") Then WinKill("[Title:" & $title & "; Class:#32770]") MsgBox(48, "Warning", "Error window is exists") EndIf EndFunc Func _Exit() DllCallbackFree($DllHandle) DllCall("user32.dll", "int", "KillTimer", "hwnd", 0, "uint", $TimerProc[0]) Exit EndFunc 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