What is the Last Window Opened?
Posted by admin - Apr 1, 2008 Articles, Dani Vainstein, QTips, Windows 0 0 Views : 294 Receive Updates For This Category
Article Tools
- Print this page
- Add Comment
- Send to Friend
- Last Updated on :
Jul 16, 2011
Sometimes applications display reports, when the window title depends on server, ip, date an time, report type etc.
you can’t predict what will be the window title, only during runtime. I met this issue when an application display several reports types after selecting a menu item. my task is to verify that the window was opened.
The GetForegroundWindow function returns a handle to the foreground window (the window with which the user is currently working). The system assigns a slightly higher priority to the thread that creates the foreground window than it does to other threads.
API syntax : HWND GetForegroundWindow(VOID);
Return Value : Handle to the window or zero otherwise.
Extern.Declare micHWnd, "GetForegroundWindow", "user32.dll", "GetForegroundWindow"
hwnd = Extern.GetForegroundWindow()
title = Window("hwnd:=" & hwnd ).GetROProperty( "title" )


