Jump to content

WinQueryActiveWindow

From EDM2

This function returns the active window for HWND_DESKTOP, or other parent window.

Syntax

 WinQueryActiveWindow(hwndParent)

Parameters

hwndParent (HWND) - Input
Parent-window handle for which the active window is required.
HWND_DESKTOP
The desktop-window handle that causes this function to return the top-level frame window.
Other
Specified parent-window handle.

Returns

hwndActive (HWND) - returns
Active-window handle.
NULLHANDLE
No window is active
Other
Active-window handle.

Errors

Possible returns from WinGetLastError:

  • PMERR_INVALID_HWND (0x1001) An invalid window handle was specified.

Example Code

#define INCL_WINWINDOWMGR
#include <OS2.H>

HWND hwndActive;

hwndActive = WinQueryActiveWindow(HWND_DESKTOP);

Related Functions