Jump to content
Sign in to follow this  

How to detect 3rd party error window?

Recommended Posts


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

Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
Share on other sites


Mayb 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

Func _CheckWindow()
    If WinExists("[Title:" & $title & "; Class:#32770]") Then
        WinKill("[Title:" & $title & "; Class:#32770]")
        MsgBox(48, "Warning", "Error window is exists")

Func _Exit()
    DllCall("user32.dll", "int", "KillTimer", "hwnd", 0, "uint", $TimerProc[0])

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.