cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid "Can't find window..." when testing if sys.desktop.activewindow.exists?

SOLVED
Highlighted
Frequent Contributor

How to avoid "Can't find window..." when testing if sys.desktop.activewindow.exists?

Hi,

Occasionally my code crashes when I test if sys.desktop.ActiveWindow.exists because "Cannot find the window with handle xxxxx".

The line immediately before the condition is sys.Refresh so I would have to be extremely unlucky for my object to be destroyed in the milliseconds since the refresh but it keeps happening.

Ho do I test this? Do I need to use isnull(sys.Desktop.ActiveWindow) instead?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Contributor

Re: How to avoid "Can't find window..." when testing if sys.desktop.activewindow.exists?

I ended up using aqobject.issupported(myObj, "Exists") instead but thanks.

View solution in original post

2 REPLIES 2
Highlighted
Community Hero

Re: How to avoid "Can't find window..." when testing if sys.desktop.activewindow.exists?

Highlighted
Frequent Contributor

Re: How to avoid "Can't find window..." when testing if sys.desktop.activewindow.exists?

I ended up using aqobject.issupported(myObj, "Exists") instead but thanks.

View solution in original post