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" )
Posted in Windowing


daniva




April 26th, 2008 at 1:19 pm
Dani a bit correction is required…..2nd line should be Extern.GetForegroundWindow()…otherwise it will throw an error
April 27th, 2008 at 5:30 pm
Yes…you right
it wa a copy-paste mistake
it will be fixed soon
May 10th, 2008 at 8:09 am
Mr Dani which book should i refer to learn window api like the above one??