CTaskDialog::ShowDialog
Creates and displays a CTaskDialog.
static INT_PTR ShowDialog(
const CString& strContent,
const CString& strMainInstruction,
const CString& strTitle,
int nIDCommandControlsFirst,
int nIDCommandControlsLast,
int nCommonButtons = TDCBF_YES_BUTTON | TDCBF_NO_BUTTON,
int nTaskDialogOptions = TDF_ENABLE_HYPERLINKS | TDF_USE_COMMAND_LINKS,
const CString& strFooter = _T("")
);
This static method enables you to create an instance of the CTaskDialog Class without explicitly creating a CTaskDialog object in your code. Because there is no CTaskDialog object, you cannot call any other methods of the CTaskDialog if you use this method to show a CTaskDialog to the user.
This method creates command button controls by using data from the resource file of your application. The string table in the resource file has several strings with associated string IDs. This method adds a command button control for each valid entry in the string table between nIDCommandControlsFirst and nCommandControlsLast, inclusive. For these command button controls, the string in the string table is the control's caption and the string ID is the control's ID.
See CTaskDialog::SetOptions for a list of valid options.
The CTaskDialog closes when the user selects a common button, a command link control, or closes the CTaskDialog. The return value is the identifier that indicates how the user closed the dialog box.
// TODO: Replace the string below with the actual message to the user CString message("Important information to the user"); // TODO: Replace the string below with the title of this project CString title("Project Title"); CString emptyString; if (CTaskDialog::IsSupported()) { CTaskDialog::ShowDialog(message, emptyString, title, 0, 0, TDCBF_OK_BUTTON); } else { AfxMessageBox(message); }