Jump to content

WinSetActiveWindow: Difference between revisions

From EDM2
No edit summary
No edit summary
 
Line 2: Line 2:


==Syntax==
==Syntax==
 WinSetActiveWindow(hwndDeskTop, hwnd)
WinSetActiveWindow(hwndDeskTop, hwnd)


==Parameters==
==Parameters==

Latest revision as of 18:20, 9 April 2025

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