This project is read-only.

Detecting an application window

Dec 4, 2011 at 8:44 PM


We have an application that once invoked leads to 1.> 'Login' window.  After the user successfully enters the credentials 2.> a splash screen is seen on the desktop.  This screen is temporary and displays the database objects that are getting loaded etc. Finally, as soon as the splash screen disappears 3.> the main application window pops up. 

I can very well detect the 'Login' window with the code below.


Application application = Application.Launch(@"C:\Windows\System32\calc.exe");           

Window w = application.GetWindow("Login");

What is the way to detect the main application window referred by #3 above?  Is the below code the only way to get the main application window?

List windows = Desktop.Instance.Windows();


thanks & regards,


Dec 5, 2011 at 5:36 AM


Window referred by #3 is run by another process ? If so you need to attach that process via Application.Attach(processName). If not and this is same process like in "Login" window you need to simply get it. application.GetWindow(windowName) like you did with "Login"

Hope it helps. 

Dec 5, 2011 at 7:06 AM

Hi niosocket,

Thank you for your reply.  I tried to check the availability of process name using UISPY.  However, I did not see the process name in it for an of the windows (Login or main application window).  Instead, I only see the process Id parameter (varying at run-time) which has a same value for the two windows.

Thank you for the help again ...