1. Best method to see if a window is 'Open' using win32lib.
- Posted by ssallen Dec 11, 2009
- 840 views
Hello,
I need to check to see if a window is currently open and I am not seeing any easy way. Am I missing something?
I tried using getWindowInfo() but it only shows whether the window is "active". Which I guess means it has focus because if I open 3 windows and then call getWindowInfo on all 3 then I only ever get a returned status of 1 on the main window. The rest whether they are open or not all return 0.
Whats the best way of going about this? Ideally I just want an easy way of maximizing all open windows or minimizing all open windows. If a window isn't open then I obviously don't want either action to occur to it.
Thanks! Steve
2. Re: Best method to see if a window is 'Open' using win32lib.
- Posted by DerekParnell (admin) Dec 11, 2009
- 825 views
Hello,
I need to check to see if a window is currently open and I am not seeing any easy way.
Try this ...
if getControlInfo( aWindow, CONTROLINFO_closed) != 0 then -- Window is closed. else -- Window is opened. end if
The possible return values are ...
- -1 : Window has never been opened.
- 0 : Window is currently opened.
- 1 : Window is closed.
- 2 : Window is in the process of being closed.
Hope this helps.
3. Re: Best method to see if a window is 'Open' using win32lib.
- Posted by ssallen Dec 11, 2009
- 881 views
That works perfect!
Thank you sir!
Steve A.