WinSetSysModalWindow: Difference between revisions
Created page with "This function makes a window become the system-modal window, or ends the system-modal state. ==Syntax== WinSetSysModalWindow(hwndDesktop, hwnd) ==Parameters== ;hwndDesktop (HWND) - Input : Desktop-window handle, or HWND_DESKTOP. ;hwnd (HWND) - Input : Handle of window to become system-modal window. : If NULLHANDLE, system-modal state is ended, and input processing returns to its normal state. ==Returns== ;rc (BOOL) - returns :Success indicator. :;TRUE ::..." |
No edit summary |
||
Line 2: | Line 2: | ||
==Syntax== | ==Syntax== | ||
WinSetSysModalWindow(hwndDesktop, hwnd) | |||
==Parameters== | ==Parameters== |
Revision as of 18:10, 9 April 2025
This function makes a window become the system-modal window, or ends the system-modal state.
Syntax
WinSetSysModalWindow(hwndDesktop, hwnd)
Parameters
- hwndDesktop (HWND) - Input
- Desktop-window handle, or HWND_DESKTOP.
- hwnd (HWND) - Input
- Handle of window to become system-modal window.
- If NULLHANDLE, system-modal state is ended, and input processing returns to its normal state.
Returns
- rc (BOOL) - returns
- Success indicator.
- TRUE
- Successful completion
- FALSE
- Error occurred.
Remarks
Input processing can enter a "system modal" state. In this state, all pointing device and keyboard input is directed to a special window, known as the system-modal window, or to one of its child windows (or a window owned by one of them). An "owned" window is a window that refers to its owner window set by using either the Template:Hp1 parameter of the WinCreateWindow function or the Template:Hp1 parameter of the WinSetOwner function. All other main windows behave as though they are disabled and no interaction is possible with them. Template:Hp2 The disabled windows are not actually disabled, but made noninteractive. No messages are sent to these windows when the system-modal state is entered or left, and their WS_DISABLE style bits are not changed. Where a system-modal window exists and another window is explicitly made the active window, the newly activated window becomes the system-modal window. This replaces the old one, which becomes a noninteractive window. When the system-modal window is destroyed, the system-modal state is ended, and input processing returns to its normal state. This function should only be called while processing pointing device or keyboard input. The new system-modal window is Template:Hp2 locked during the processing of this function.
Errors
Possible returns from WinGetLastError:
- PMERR_INVALID_HWND (0x1001) An invalid window handle was specified.
Example Code
#define INCL_WINWINDOWMGR #include <OS2.H> HWND hwndSysModal; /* Input processing can enter a "system modal" state. In */ /* this state, all pointing device and keyboard input */ /* is directed to a special window, known as the */ /* system-modal window. Typically, this will be a dialog */ /* window requiring input. */ WinSetSysModalWindow(HWND_DESKTOP,hwndSysModal);