Dialog::DoModal

Contents

Description

Call this member function to invoke the modal dialog box and return the dialog-box result when done.

Syntax

int DoModal( HWND hWndParent = NULL, DWORD dwOptions = 0, LPCSTR OpsName = NULL )

Parameters

hWndParent
Specifies the parent window, or NULL to use the active window
dwOptions
flags to control the dialog. Including,
DLG_OPTIONS_SHIFT_SHOW_DEFAULT_TRUE
This flag is for dialogs that contains a check box for Show-only-if-shift-key-is-down,
If this flag is on, the default value for this check box will be true. Please note that once the dialog is open and closed normally,
this setting (ShiftShow) will be saved into Origin.ini, so this parameter is used only when the dialog is opened the first time.
DLG_OPTIONS_USE_OPS
This flag can be used to turn on the recording mechanism in Dialog Builder. Please note that only controls that have a string table entry will participate in recording.
DLG_NO_LOAD_TOP_LEFT
DLG_NO_LOAD_WIDTH_HEIGHT
ignore the settings in registry when open dialog
OpsName

Return

The ID of the button click to close the dialog box, or -1 if the dialog cannot be loaded for whatever reason.

Examples

EX1

#include <..\OriginLab\DialogEx.h>
#define IDC_EDIT1 1001

void Dialog_DoModal(Dialog& MyDlg)
{
        MyDlg.DoModal(GetWindow());
}

Remark

See Also

header to Include

Dialog.h