Jump to content

WinSetActiveWindow

From EDM2
Revision as of 16:29, 9 April 2025 by Martini (talk | contribs) (Created page with "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. : {{hp1|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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.
Template:Hp1 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