python - FindWindowEx doesn't find MessageBox appearing over Remote Desktop Connection -


we have build machine on daily builds , execute tests @ application develop. problem tests failing because of our executables crashing. , if crash failed test.

but instead of fail popup prevents them finishing. killed after determined time (5-10 minutes usually). overcome issue creating "watchdog" periodically checks popups , closes them when found. python code checking here:

def checkgenericpopupbyclassname(hwnd,classname):     # pass none desktop popups      hwndpopup = none     hwndfirst = none     consecutiveexceptioncount = 0     # check popups on desktop     while true:         try:             hwndpopup = win32gui.findwindowex(hwnd, hwndpopup, classname, none) # check spy++ class name         except exception e:             print("checkgenericpopupbyclassname exception:"+str(e))             hwndpopup = hwndfirst = none             consecutiveexceptioncount = consecutiveexceptioncount + 1             if consecutiveexceptioncount > 5:                 return             continue          consecutiveexceptioncount = 0          if hwndpopup none or hwndpopup 0 or hwndpopup hwndfirst:             break          if hwndfirst none:             hwndfirst = hwndpopup          handlegenericpopup(hwndpopup) # closes popup 

the problem messagebox above remote desktop connection login , not found previous method. after login remote desktop connection popups found function periodically called.

the messagebox csrss.exe (i saw process explorer) , has following text:

"xxxxx.exe - application error"

"the instruction @ <...> referenced memory @ <...> . memory not read."

click on ok terminate program

click on cancel debug program

i this: can "application error" dialog box disabled?

but want know why findwindowex doesn't find messagebox in case. ideas should find messagebox?

thanks!

later edit: solution disable popups can found here.

i chose avoid showing popup.

i used the solution microsoft site.


Comments