Jump to content

WinSetActiveWindow

From EDM2
Revision as of 17:26, 9 April 2025 by Martini (talk | contribs)

This function makes the frame window the active window.

Syntax

 WinSetActiveWindow(hwndDeskTop, hwnd)

Parameters

hwndDeskTop (HWND) - Input
Desktop-window handle.
HWND_DESKTOP
The desktop-window handle
Other
Specified desktop-window handle.
hwnd (HWND) - Input
Window handle.
hwnd is either the frame window or its child. If it is a child, the parent frame window will become the active window.

Returns

rc (BOOL) - returns
Active-window-set indicator.
TRUE
Active window is set
FALSE
Active window is not set.

Remarks

This function is equivalent to the WinFocusChange function in which the Template:Hp1 parameter is set.

Errors

Possible returns from WinGetLastError:

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

Example Code

#define INCL_WINWINDOWMGR
#include <OS2.H>

HWND hwnd;

WinSetActiveWindow(HWND_DESKTOP,hwnd);

Related Functions