WinDlgBox: Difference between revisions
Appearance
No edit summary |
|||
Line 24: | Line 24: | ||
;''pCreateParams'' ([[PVOID]]) - input: Pointer to application-defined data area. | ;''pCreateParams'' ([[PVOID]]) - input: Pointer to application-defined data area. | ||
:This is passed to the dialog procedure in the [[ | :This is passed to the dialog procedure in the [[WM_INITDLG]] message. | ||
:This parameter MUST be a pointer rather than a long. | :This parameter MUST be a pointer rather than a long. | ||
Revision as of 15:45, 15 May 2025
This function loads and processes a modal dialog window and returns the result value established by the WinDismissDlg call.
Syntax
WinDlgBox(hwndParent, hwndOwner,pfnDlgProc, hmod, idDlg, pCreateParams);
Parameters
- hwndParent (HWND) - input
- Parent-window handle of the created dialog window.
- HWND\_DESKTOP: The desktop window.
- HWND\_OBJECT: Object window.
- Other: Specified window.
- hwndOwner (HWND) - input
- Requested owner-window handle of the created dialog window.
- The actual owner window is calculated using the algorithm specified in the description of the WinLoadDlg function.
- pfnDlgProc (PFNWP) - input
- Dialog procedure for the created dialog window.
- hmod (HMODULE) - input
- Resource identity containing the dialog template.
- NULLHANDLE: Use the application's .EXE file.
- Other: Module handle returned from the DosLoadModule or DosQueryModuleHandle call.
- idDlg (ULONG) - input
- Dialog-template identity within the resource file.
- It is also used as the identity of the created dialog window. It must be greater than or equal to 0 and less than or equal to 0xFFFF.
- pCreateParams (PVOID) - input
- Pointer to application-defined data area.
- This is passed to the dialog procedure in the WM_INITDLG message.
- This parameter MUST be a pointer rather than a long.
Returns
- ulResult (ULONG) - returns
- Reply value.
- Value established by the WinDismissDlg call or DID\_ERROR if an error occurs.
Remarks
The use of parameters for this function is the same as those of the WinLoadDlg function.
This function should not be used while pointing device capture is set (see WinSetCapture).
This function does not return until WinDismissDlg is called.
Example Code
Declaration:
#define INCL_WINDIALOGS /* Or use INCL_WIN, INCL_PM, Also in COMMON section */ #include <os2.h> HWND hwndParent; /* Parent-window handle of the created dialog window. */ HWND hwndOwner; /* Requested owner-window handle of the created dialog window. */ PFNWP pfnDlgProc; /* Dialog procedure for the created dialog window. */ HMODULE hmod; /* Resource identity containing the dialog template. */ ULONG idDlg; /* Dialog-template identity within the resource file. */ PVOID pCreateParams; /* Pointer to application-defined data area. */ ULONG ulResult; /* Reply value. */ ulResult = WinDlgBox(hwndParent, hwndOwner, pfnDlgProc, hmod, idDlg, pCreateParams);