Jump to content

WinSetActiveWindow

From EDM2

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 flFocusChange 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