Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
WinDlgBox (1.2)
◄Function Group► ◄Overview► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_WINDIALOGS
USHORT WinDlgBox(hwndParent, hwndOwner, pfnDlgProc, hmod, idDlg,
pCreateParams)
HWND hwndParent; /* handle of the parent window */
HWND hwndOwner; /* handle of the owner window */
PFNWP pfnDlgProc; /* dialog procedure address */
HMODULE hmod; /* handle of the resource module */
USHORT idDlg; /* identifies the dialog */
PVOID pCreateParams; /* address of application-specific data */
The WinDlgBox function loads and processes a modal dialog box and returns
the usResult value passed to the WinDismissDlg function. It is equivalent to
calling WinLoadDlg, WinProcessDlg, and WinDestroyWindow.
This function does not return until the dialog procedure calls the
WinDismissDlg function.
Parameter Description
────────────────────────────────────────────────────────────────────────────
hwndParent Identifies the parent window.
hwndOwner Identifies the owner window. This window must be a descendant
of hwndParent.
pfnDlgProc Points to the dialog procedure.
hmod Identifies the module that contains the dialog template. This
parameter can be either the module handle returned by the
DosLoadModule function or NULL for the application's module.
idDlg Identifies the dialog window.
pCreateParams Points to application-specific data that is passed to the
dialog procedure as part of the WM_INITDLG message.
Return Value
The return value is the value specified in the usResult parameter of the
WinDismissDlg function, or it is DID_ERROR if an error occurred while trying
to load the dialog box.
Example
This example processes an application-defined message (IDM_OPEN) and calls
WinDlgBox to load a dialog box.
case IDM_OPEN:
if (WinDlgBox(HWND_DESKTOP,
hwndFrame, /* handle of the owner */
OpenDlg, /* dialog procedure address */
(HMODULE) NULL, /* location of dialog resource */
IDD_OPEN, /* resource identifier */
(PVOID) NULL)) { /* application-specific data */
.
. /* code executed if dialog box returns TRUE */
.
}
See Also
DosLoadModule, WinDismissDlg, WinLoadDlg, WinProcessDlg, DLGTEMPLATE,
WM_INITDLG
♦