pnp Posted November 20, 2006 Share Posted November 20, 2006 Using AutoIT scripts to test a GUI, we sometimes encounter a problem with the text "guiname" has encountered a problem, please tell microsoft....send/don't send. Is there a way to detect this dialog an kill it by sending ("{!d}")? I have tried using WinActive("dialog name", "has encountered a problem"), but it does not seem to locate the open dialog. Regards, Kasper Andersen Link to comment Share on other sites More sharing options...
MHz Posted November 20, 2006 Share Posted November 20, 2006 (edited) Welcome,You can use Adlib to look for the window. BadApp tested this ok for me.AdlibEnable('_Adlib') ; checking for unexpected window here AdlibDisable() Exit Func _Adlib() Local $title = 'BadApp.exe' If WinExists($title) Then ControlClick($title, 'De&bug', 'Button1') EndIf EndFunc Edited November 20, 2006 by MHz Link to comment Share on other sites More sharing options...
pnp Posted November 20, 2006 Author Share Posted November 20, 2006 Welcome, You can use Adlib to look for the window. BadApp tested this ok for me. AdlibEnable('_Adlib') ; checking for unexpected window here AdlibDisable() Exit Func _Adlib() Local $title = 'BadApp.exe' If WinExists($title) Then ControlClick($title, 'De&bug', 'Button1') EndIf EndFunc Thanks for the quick reply. Would this also work when Windows has a habbit of naming the error window the same as the main app. Thanks. Link to comment Share on other sites More sharing options...
MHz Posted November 20, 2006 Share Posted November 20, 2006 The title would be unique to the app (process name as title) so you need to alter to suit. The ControlID should be the same with each use. Link to comment Share on other sites More sharing options...
pnp Posted November 20, 2006 Author Share Posted November 20, 2006 Now after having tried several things, I am still left at where I once began :-) The status of both dialogs, which ARE named the same, is "Not Running" in the task manager and even if I try to activate window it still does not work correctly, with either adlib, winactive or winexists. Detecting on the window title just applies the kill to the main window at an early stage. I tried to use the "open window info" tool inside the AutoIT, but as the microsoft error dialog has topmost priority on its thread, the info tool won't work at all, as long as the error shows. I still am hoping that someone has tried this on a windows xp or newer OS. I guess that there would be no problem in Windows 2000, as it does not have the report error function from Microsoft. Thanks. Link to comment Share on other sites More sharing options...
MHz Posted November 20, 2006 Share Posted November 20, 2006 Now after having tried several things, I am still left at where I once began :-)I do not understand your results. Try this with the BadApp I linked above $pid = Run('"' & @ScriptDir & '\BadApp.exe"') AdlibEnable('_Adlib') WinWait('Bad Application') ControlClick('Bad Application', '', 'Button12') ProcessWaitClose($pid) AdlibDisable() Exit Func _Adlib() $title = 'BadApp.exe' If WinExists($title) Then ControlClick($title, 'De&bug', 'Button1') EndIf EndFunc It closes the microsoft error window for me just fine. Link to comment Share on other sites More sharing options...
pnp Posted November 21, 2006 Author Share Posted November 21, 2006 I do not understand your results. Try this with the BadApp I linked above $pid = Run('"' & @ScriptDir & '\BadApp.exe"') AdlibEnable('_Adlib') WinWait('Bad Application') ControlClick('Bad Application', '', 'Button12') ProcessWaitClose($pid) AdlibDisable() Exit Func _Adlib() $title = 'BadApp.exe' If WinExists($title) Then ControlClick($title, 'De&bug', 'Button1') EndIf EndFunc It closes the microsoft error window for me just fine. I sorted the thing out last night. When the Microsoft error reporting service window shows, a process named dwwin.exe is run. By looking for it using ProcessExists and closing it using ProcessClose i managed to deal with the error quite nicely. Thanks anyway. Regards, Kasper Andersen 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