This project is read-only.

How to get current active window

Aug 1, 2008 at 5:10 PM
Hi all.

I am new to white and am trying to get the current active window.  Any suggestions on how to do this?  I looked at going through all the current windows but there is no property that a particular window is active.  (IsFocussed and IsEnabled are always false)

What I am trying to acheive is that as I test my GUI, depending on what happens, different message boxes appear. It may be that if no message box appears and my main window is still active then the test passed, or I am expecting a specific message box that I can look for to appear and if it is there then the test passed. 
The problem is if there is an error in the test, some of them I can just click on an custom error box and continue the test others would cause the test to fail.  Currently I cannot determine a way to see if an unexpected message box appears on the screen.

I know I can use GetForegroundWindow to get a handle to the current active window but I cant find any way to match that to the list of windows in the test app.  Since I have several different message boxes that can appear on a window I really dont want to make a list of all possible windows then check to see if any one of them is there to indicate a failure. 

Aug 5, 2008 at 3:37 PM
I am marking this as an feature which I would add to the next release of white.
Sep 22, 2008 at 5:03 PM
Hi, I was also looking for this feature. What is the status of it?

Jose Tavares
Sep 23, 2008 at 5:14 PM
This wasn't done. Sorry about this.
I am trying to get my issue tracking in order so that it is clear what is getting done when.
Nov 9, 2008 at 12:51 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.