What is the Last Window Opened?

Article Tools

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" )
Previous postFind a Window Next postReading a Specific Key String from ini File

Related Posts

Post Your Comment

You must be logged in to post a comment.