Jump to content

WinSetActiveWindow: Difference between revisions

From EDM2
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..."
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:


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


==Parameters==
==Parameters==
Line 13: Line 13:
;hwnd ([[HWND]]) - Input
;hwnd ([[HWND]]) - Input
: Window handle.
: 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.
: hwnd is either the frame window or its child. If it is a child, the parent frame window will become the active window.


==Returns==
==Returns==
Line 23: Line 23:


==Remarks==
==Remarks==
This function is equivalent to the [[WinFocusChange]] function in which the {{hp1|flFocusChange}} parameter is set.
This function is equivalent to the [[WinFocusChange]] function in which the flFocusChange parameter is set.


==Errors==
==Errors==

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