Поделиться через


Класс CTaskDialog

Всплывающее диалоговое окно, которое функционирует как окно сообщения, но может отображать дополнительные сведения для пользователя. CTaskDialog также включает функции для получения сведений от пользователя.

Синтаксис

class CTaskDialog : public CObject

Участники

Конструкторы

Имя Описание
CTaskDialog::CTaskDialog Формирует объект CTaskDialog.

Методы

Имя Описание
CTaskDialog::AddCommandControl Добавляет элемент управления кнопкой команды в элемент CTaskDialogуправления .
CTaskDialog::AddRadioButton Добавляет переключатель в элемент CTaskDialog.
CTaskDialog::ClickCommandControl Программным способом щелкает элемент управления кнопкой командной кнопки или общую кнопку.
CTaskDialog::ClickRadioButton Нажимает переключатель программным способом.
CTaskDialog::D oModal Отображает CTaskDialog.
CTaskDialog::GetCommonButtonCount Извлекает количество доступных общих кнопок.
CTaskDialog::GetCommonButtonFlag Преобразует стандартную кнопку Windows в тип общей кнопки, связанной с классом CTaskDialog .
CTaskDialog::GetCommonButtonId Преобразует один из распространенных типов кнопок, связанных с CTaskDialog классом, в стандартную кнопку Windows.
CTaskDialog::GetOptions Возвращает флаги параметра для этого CTaskDialog.
CTaskDialog::GetSelectedCommandControlID Возвращает выбранный элемент управления кнопкой командной строки.
CTaskDialog::GetSelectedRadioButtonID Возвращает выбранную переключатель.
CTaskDialog::GetVerificationCheckboxState Извлекает состояние поля проверки проверка.
CTaskDialog::IsCommandControlEnabled Определяет, включена ли элемент управления кнопкой командной кнопки или общая кнопка.
CTaskDialog::IsRadioButtonEnabled Определяет, включена ли переключатель.
CTaskDialog::IsSupported Определяет, поддерживает CTaskDialogли компьютер, на котором запущено приложение.
CTaskDialog::LoadCommandControls Добавляет элементы управления кнопкой команды с помощью данных из строковой таблицы.
CTaskDialog::LoadRadioButtons Добавляет переключатели с помощью данных из строковой таблицы.
CTaskDialog::NavigateTo Передает фокус другому CTaskDialog.
CTaskDialog::OnCommandControlClick Платформа вызывает этот метод, когда пользователь щелкает элемент управления кнопкой командной кнопки.
CTaskDialog::OnCreate Платформа вызывает этот метод после создания CTaskDialog.
CTaskDialog::OnDeskDialog Платформа вызывает этот метод непосредственно перед его уничтожением CTaskDialog.
CTaskDialog::OnExpandButtonClick Платформа вызывает этот метод, когда пользователь нажимает кнопку расширения.
CTaskDialog::OnHelp Платформа вызывает этот метод, когда пользователь запрашивает справку.
CTaskDialog::OnHyperlinkClick Платформа вызывает этот метод, когда пользователь щелкает гиперссылку.
CTaskDialog::OnInit Платформа вызывает этот метод при CTaskDialog инициализации.
CTaskDialog::OnNavigatePage Платформа вызывает этот метод, когда пользователь перемещает фокус относительно элементов управления.CTaskDialog
CTaskDialog::OnRadioButtonClick Платформа вызывает этот метод, когда пользователь выбирает элемент управления переключателем.
CTaskDialog::OnTimer Платформа вызывает этот метод при истечении срока действия таймера.
CTaskDialog::OnVerificationCheckboxClick Платформа вызывает этот метод, когда пользователь щелкает поле проверки проверка.
CTaskDialog::RemoveAllCommandControls Удаляет все элементы управления командой из элемента CTaskDialogуправления .
CTaskDialog::RemoveAllRadioButtons Удаляет все переключатели из переключателя CTaskDialog.
CTaskDialog::SetCommandControlOptions Обновления элемент управления кнопкой командной кнопки в элементе CTaskDialogуправления .
CTaskDialog::SetCommonButtonOptions Обновления подмножество распространенных кнопок, которые необходимо включить и требовать повышение прав пользователей.
CTaskDialog::SetCommonButtons Добавляет общие кнопки в CTaskDialog.
CTaskDialog::SetContent Обновления содержимое CTaskDialogобъекта .
CTaskDialog::SetDefaultCommandControl Задает элемент управления командной кнопкой по умолчанию.
CTaskDialog::SetDefaultRadioButton Задает переключатель по умолчанию.
CTaskDialog::SetDialogWidth Настраивает ширину CTaskDialogэлемента .
CTaskDialog::SetExpansionArea Обновления область CTaskDialogрасширения .
CTaskDialog::SetFooterIcon Обновления значок нижнего колонтитула для CTaskDialog.
CTaskDialog::SetFooterText Обновления текст в нижнем колонтитулеCTaskDialog.
CTaskDialog::SetMainIcon Обновления главный значок элемента CTaskDialog.
CTaskDialog::SetMainInstruction Обновления основную инструкцию CTaskDialog.
CTaskDialog::SetOptions Настраивает параметры для CTaskDialog.
CTaskDialog::SetProgressBarMarquee Настраивает панель маркирования для окна CTaskDialog и добавляет ее в диалоговое окно.
CTaskDialog::SetProgressBarPosition Настраивает положение индикатора выполнения.
CTaskDialog::SetProgressBarRange Настраивает диапазон индикатора выполнения.
CTaskDialog::SetProgressBarState Задает состояние индикатора выполнения и отображает его на панели CTaskDialogвыполнения.
CTaskDialog::SetRadioButtonOptions Включает или отключает переключатель.
CTaskDialog::SetVerificationCheckbox Задает проверка состояние поля проверки проверка.
CTaskDialog::SetVerificationCheckboxText Задает текст справа от поля проверки проверка.
CTaskDialog::SetWindowTitle Задает заголовок CTaskDialog.
CTaskDialog::ShowDialog Создает и отображает объект CTaskDialog.
CTaskDialog::TaskDialogCallback Платформа вызывает это в ответ на различные сообщения Windows.

Элементы данных

Имя Описание
m_aButtons Массив элементов управления кнопкой командной строки для CTaskDialogэлемента управления .
m_aRadioButtons Массив элементов управления переключателем для CTaskDialogэлемента управления .
m_bVerified TRUEуказывает, что поле проверки проверка проверка; FALSE указывает, что это не так.
m_footerIcon Значок в нижнем колонтитуле .CTaskDialog
m_hWnd Дескриптор окна для CTaskDialog.
m_mainIcon Главный CTaskDialogзначок элемента .
m_nButtonDisabled Маска, указывающая, какие из распространенных кнопок отключены.
m_nButtonElevation Маска, указывающая, какие из распространенных кнопок требуют повышения прав пользователей.
m_nButtonId Идентификатор выбранного элемента управления кнопкой командной строки.
m_nCommonButton Маска, указывающая, какие распространенные кнопки отображаются в элементе CTaskDialog.
m_nDefaultCommandControl Идентификатор элемента управления кнопки команды, выбранного при CTaskDialog отображении.
m_nDefaultRadioButton Идентификатор элемента управления переключателя, выбранного при CTaskDialog отображении.
m_nFlags Маска, указывающая параметры для CTaskDialog.
m_nProgressPos Текущая позиция для индикатора выполнения. Это значение должно принадлежать диапазону от m_nProgressRangeMin до m_nProgressRangeMax.
m_nProgressRangeMax Максимальное значение для индикатора выполнения.
m_nProgressRangeMin Минимальное значение для индикатора выполнения.
m_nProgressState Состояние индикатора выполнения. Дополнительные сведения см. в разделе CTaskDialog::SetProgressBarState.
m_nRadioId Идентификатор выбранного элемента управления переключателем.
m_nWidth Ширина в пикселях CTaskDialog .
m_strCollapse Строка, отображаемая CTaskDialog справа от поля расширения, когда развернутая информация скрыта.
m_strContent Строка содержимого CTaskDialogобъекта .
m_strExpand Строка CTaskDialog , отображаемая справа от поля расширения при отображении развернутой информации.
m_strFooter Нижний CTaskDialogколонтитул .
m_strInformation Развернутые сведения для CTaskDialog.
m_strMainInstruction Основная инструкция CTaskDialog.
m_strTitle Заголовок CTaskDialog.
m_strVerification Строка, отображаемая CTaskDialog справа от поля проверки проверка.

Замечания

Класс CTaskDialog заменяет стандартное окно сообщений Windows и имеет дополнительные функции, такие как новые элементы управления для сбора информации от пользователя. Этот класс находится в библиотеке MFC в Visual Studio 2010 и более поздних версиях. Доступно CTaskDialog начиная с Windows Vista. Более ранние версии Windows не могут отображать CTaskDialog объект. Используется CTaskDialog::IsSupported для определения во время выполнения, может ли текущий пользователь отображать диалоговое окно задачи. Стандартное окно сообщений Windows по-прежнему поддерживается.

Он CTaskDialog доступен только при создании приложения с помощью библиотеки Юникода.

У CTaskDialog него есть два разных конструктора. Один конструктор позволяет указать две кнопки команды и не более шести обычных элементов управления кнопками. После создания кнопки можно добавить дополнительные кнопки CTaskDialogкоманд. Второй конструктор не поддерживает никакие кнопки команд, но вы можете добавить неограниченное количество обычных элементов управления кнопками. Дополнительные сведения о конструкторах см. в разделе CTaskDialog::CTaskDialog.

На следующем рисунке показан пример CTaskDialog для иллюстрации расположения некоторых элементов управления.

Example of CTaskDialog.
Пример CTaskDialog

Требования

Минимальная требуемая операционная система: Windows Vista

Заголовок: afxtaskdialog.h

CTaskDialog::AddCommandControl

Добавляет новый элемент управления кнопкой командной строки в элемент CTaskDialogуправления .

void AddCommandControl(
    int nCommandControlID,
    const CString& strCaption,
    BOOL bEnabled = TRUE,
    BOOL bRequiresElevation = FALSE);

Параметры

nCommandControlID
[in] Идентификационный номер элемента управления командой.

strCaption
[in] Строка, CTaskDialog отображаемая пользователю. Используйте эту строку, чтобы объяснить назначение команды.

bEnabled
[in] Логический параметр, указывающий, включена ли новая кнопка или отключена.

bRequiresElevation
[in] Логический параметр, указывающий, требуется ли команда повышения прав.

Замечания

Может CTaskDialog Class отображаться неограниченное количество элементов управления кнопкой командной строки. Однако если в элементе CTaskDialog управления кнопкой команд отображается не более шести кнопок. CTaskDialog Если элемент управления командой отсутствует, он может отображать неограниченное количество кнопок.

Когда пользователь выбирает элемент управления кнопкой командной строки, CTaskDialog закрывается. Если приложение отображает диалоговое окно с помощью CTaskDialog::D oModal, DoModal возвращает nCommandControlID выбранного элемента управления кнопкой.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title.
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

taskDialog.AddCommandControl(201, L"First command button control");
taskDialog.AddCommandControl(202, L"Second command button control");
taskDialog.AddCommandControl(203, L"Third command button control");

// Show the CTaskDialog and remember how the user closed it.
int selection = taskDialog.DoModal();

switch (selection)
{
case 201:
   // TODO: Place processing here for the first
   // command button control.
   break;

case 202:
   // TODO: Place processing here for the second
   // command button control.
   break;

case 203:
   // TODO: Place processing here for the third
   // command button control.
   break;

default:
   break;
}

// Remove all the command controls so that we can use the same task
// dialog with new command button controls.
taskDialog.RemoveAllCommandControls();

taskDialog.AddCommandControl(301,
                             L"New first command button control");
taskDialog.AddCommandControl(302,
                             L"New second command button control should require elevation",
                             TRUE, TRUE);
taskDialog.AddCommandControl(303,
                             L"New third command button control should be disabled");

// Change the default command button control
taskDialog.SetDefaultCommandControl(302);

// Make sure the third option is disabled.
if (taskDialog.IsCommandControlEnabled(303))
{
   taskDialog.SetCommandControlOptions(303, FALSE);
}

taskDialog.DoModal();

switch (taskDialog.GetSelectedCommandControlID())
{
case 301:
   // TODO: Place processing here for new first
   // command button control.
   break;

case 302:
   // TODO: Place processing here for new second
   // command button control.
   break;

case 303:
   // TODO: Place processing here for the new third
   // command button control.
   break;

default:
   break;
}

// Remove all the command button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllCommandControls();
taskDialog.LoadCommandControls(1001, 1005);

CTaskDialog::AddRadioButton

Добавляет переключатель в элемент CTaskDialog.

void CTaskDialog::AddRadioButton(
    int nRadioButtonID,
    const CString& strCaption,
    BOOL bEnabled = TRUE);

Параметры

nRadioButtonID
[in] Идентификационный номер переключателя.

strCaption
[in] Строка, отображаемая CTaskDialog рядом с переключателем.

bEnabled
[in] Логический параметр, указывающий, включена ли переключатель.

Замечания

Переключатели для класса CTaskDialog позволяют собирать сведения от пользователя. Используйте функцию CTaskDialog::GetSelectedRadioButtonID , чтобы определить, какой переключатель выбран.

Не CTaskDialog требуется, чтобы параметры nRadioButtonID были уникальными для каждой переключателя. Однако вы можете столкнуться с непредвиденным поведением, если для каждой переключателя не используется отдельный идентификатор.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

taskDialog.AddRadioButton(201, L"First option");
taskDialog.AddRadioButton(202, L"Second option");
taskDialog.AddRadioButton(203, L"Third option");

taskDialog.DoModal();
int selection = taskDialog.GetSelectedRadioButtonID();

switch (selection)
{
case 201:
   // TODO: Place processing here for the first
   // radio button.
   break;

case 202:
   // TODO: Place processing here for the second
   // radio button.
   break;

case 203:
   // TODO: Place processing here for the third
   // radio button.
   break;

default:
   break;
}

// Remove all the radio buttons so that we can use the same task
// dialog with new radio buttons.
taskDialog.RemoveAllRadioButtons();

taskDialog.AddRadioButton(301, L"New first option");
taskDialog.AddRadioButton(302, L"New second option");
taskDialog.AddRadioButton(303,
                          L"New third option should be disabled");

// Change the default radio button to the second option
taskDialog.SetDefaultRadioButton(302);

// Make sure the third option is disabled.
if (taskDialog.IsRadioButtonEnabled(303))
{
   taskDialog.SetRadioButtonOptions(303, FALSE);
}

taskDialog.DoModal();
selection = taskDialog.GetSelectedRadioButtonID();

switch (taskDialog.GetSelectedRadioButtonID())
{
case 301:
   // TODO: Place processing here for new first
   // command button control.
   break;

case 302:
   // TODO: Place processing here for new second
   // command button control.
   break;

case 303:
   // TODO: Place processing here for the new third
   // command button control.
   break;

default:
   break;
}

// Remove all the radio button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllRadioButtons();
taskDialog.LoadRadioButtons(1001, 1005);

CTaskDialog::ClickCommandControl

Программным способом щелкает элемент управления кнопкой командной кнопки или общую кнопку.

protected:
void ClickCommandControl(int nCommandControlID) const;

Параметры

nCommandControlID
[in] Идентификатор команды элемента управления, который нужно щелкнуть.

Замечания

Этот метод создает сообщение Windows TDM_CLICK_BUTTON.

CTaskDialog::ClickRadioButton

Нажимает переключатель программным способом.

protected:
void ClickRadioButton(int nRadioButtonID) const;

Параметры

nRadioButtonID
[in] Идентификатор переключателя, который нужно нажать.

Замечания

Этот метод создает сообщение Windows TDM_CLICK_RADIO_BUTTON.

CTaskDialog::CTaskDialog

Создает экземпляр класса CTaskDialog.

CTaskDialog(
    const CString& strContent,
    const CString& strMainInstruction,
    const CString& strTitle,
    int nCommonButtons = TDCBF_OK_BUTTON | TDCBF_CANCEL_BUTTON,
    int nTaskDialogOptions = TDF_ENABLE_HYPERLINKS | TDF_USE_COMMAND_LINKS,
    const CString& strFooter = _T(""));

CTaskDialog(
    const CString& strContent,
    const CString& strMainInstruction,
    const CString& strTitle,
    int nIDCommandControlsFirst,
    int nIDCommandControlsLast,
    int nCommonButtons,
    int nTaskDialogOptions = TDF_ENABLE_HYPERLINKS | TDF_USE_COMMAND_LINKS,
    const CString& strFooter = _T(""));

Параметры

strContent
[in] Строка, используемая для содержимого CTaskDialogобъекта .

strMainInstruction
[in] Основная инструкция CTaskDialog.

strTitle
[in] Заголовок CTaskDialog.

nCommonButtons
[in] Маска общих кнопок, добавляемых в CTaskDialog.

nTaskDialogOptions
[in] Набор параметров, используемых для CTaskDialogобъекта .

strFooter
[in] Строка, используемая в качестве нижнего колонтитула.

nIDCommandControlsFirst
[in] Строковый идентификатор первой команды.

nIDCommandControlsLast
[in] Строковый идентификатор последней команды.

Замечания

Существует два способа добавления CTaskDialog в приложение. Первым способом является использование одного из конструкторов для создания CTaskDialog и отображения его с помощью CTaskDialog::D oModal. Второй способ — использовать статическую функцию CTaskDialog::ShowDialog, которая позволяет отображать CTaskDialog объект без явного CTaskDialog создания объекта.

Второй конструктор создает элементы управления кнопкой команд с помощью данных из файла ресурсов приложения. Таблица строк в файле ресурсов содержит несколько строк с связанными идентификаторами строк. Этот метод добавляет элемент управления кнопкой команд для каждой допустимой записи в строковой таблице между nIDCommandControlsFirst и nCommandControlsLast включительно. Для этих элементов управления кнопкой команды строка в строковой таблице — это подпись элемента управления, а идентификатор строки — идентификатор элемента управления.

Список допустимых параметров см. в разделе CTaskDialog::SetOptions .

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);

// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);

// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
                            L"Click here for more information.",
                            L"Click here to hide the extra information.");

// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);

taskDialog.DoModal();

CTaskDialog::D oModal

CTaskDialog Показывает и делает его модальным.

INT_PTR DoModal (HWND hParent = ::GetActiveWindow());

Параметры

hParent
[in] Родительское окно для CTaskDialogобъекта .

Возвращаемое значение

Целое число, соответствующее выбранному пользователем.

Замечания

Отображает этот экземпляр CTaskDialog. Затем приложение ожидает закрытия диалогового окна.

Закрывается CTaskDialog , когда пользователь выбирает общую кнопку, элемент управления командной ссылкой или закрывается CTaskDialog. Возвращаемое значение — это идентификатор, указывающий, как пользователь закрыл диалоговое окно.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);

// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);

// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
                            L"Click here for more information.",
                            L"Click here to hide the extra information.");

// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);

taskDialog.DoModal();

CTaskDialog::GetCommonButtonCount

Извлекает количество общих кнопок.

int GetCommonButtonCount() const;

Возвращаемое значение

Количество доступных общих кнопок.

Замечания

Распространенные кнопки — это кнопки по умолчанию, предоставляемые CTaskDialog::CTaskDialog. Класс CTaskDialog отображает кнопки в нижней части диалогового окна.

Перечисленный список кнопок предоставляется в CommCtrl.h.

CTaskDialog::GetCommonButtonFlag

Преобразует стандартную кнопку Windows в общий тип кнопки, связанный с классом CTaskDialog.

int GetCommonButtonFlag(int nButtonId) const;

Параметры

nButtonId
[in] Стандартное значение кнопки Windows.

Возвращаемое значение

Значение соответствующей общей CTaskDialog кнопки. Если нет соответствующей общей кнопки, этот метод возвращает значение 0.

CTaskDialog::GetCommonButtonId

Преобразует один из распространенных типов кнопок, связанных с классом CTaskDialog, в стандартную кнопку Windows.

int GetCommonButtonId(int nFlag);

Параметры

nFlag
[in] Общий тип кнопки, связанный с классом CTaskDialog .

Возвращаемое значение

Значение соответствующей стандартной кнопки Windows. Если нет соответствующей кнопки Windows, метод возвращает значение 0.

CTaskDialog::GetOptions

Возвращает флаги параметра для этого CTaskDialog.

int GetOptions() const;

Возвращаемое значение

Флаги для CTaskDialog.

Замечания

Дополнительные сведения о параметрах, доступных для класса CTaskDialog, см. в разделе CTaskDialog::SetOptions.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);

// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);

// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
                            L"Click here for more information.",
                            L"Click here to hide the extra information.");

// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);

taskDialog.DoModal();

CTaskDialog::GetSelectedCommandControlID

Возвращает выбранный элемент управления кнопкой командной строки.

int GetSelectedCommandControlID() const;

Возвращаемое значение

Идентификатор выбранного элемента управления кнопкой командной строки.

Замечания

Этот метод не требуется использовать для получения идентификатора кнопки команды, выбранной пользователем. Этот идентификатор возвращается CTaskDialog::D oModal или CTaskDialog::ShowDialog.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title.
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

taskDialog.AddCommandControl(201, L"First command button control");
taskDialog.AddCommandControl(202, L"Second command button control");
taskDialog.AddCommandControl(203, L"Third command button control");

// Show the CTaskDialog and remember how the user closed it.
int selection = taskDialog.DoModal();

switch (selection)
{
case 201:
   // TODO: Place processing here for the first
   // command button control.
   break;

case 202:
   // TODO: Place processing here for the second
   // command button control.
   break;

case 203:
   // TODO: Place processing here for the third
   // command button control.
   break;

default:
   break;
}

// Remove all the command controls so that we can use the same task
// dialog with new command button controls.
taskDialog.RemoveAllCommandControls();

taskDialog.AddCommandControl(301,
                             L"New first command button control");
taskDialog.AddCommandControl(302,
                             L"New second command button control should require elevation",
                             TRUE, TRUE);
taskDialog.AddCommandControl(303,
                             L"New third command button control should be disabled");

// Change the default command button control
taskDialog.SetDefaultCommandControl(302);

// Make sure the third option is disabled.
if (taskDialog.IsCommandControlEnabled(303))
{
   taskDialog.SetCommandControlOptions(303, FALSE);
}

taskDialog.DoModal();

switch (taskDialog.GetSelectedCommandControlID())
{
case 301:
   // TODO: Place processing here for new first
   // command button control.
   break;

case 302:
   // TODO: Place processing here for new second
   // command button control.
   break;

case 303:
   // TODO: Place processing here for the new third
   // command button control.
   break;

default:
   break;
}

// Remove all the command button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllCommandControls();
taskDialog.LoadCommandControls(1001, 1005);

CTaskDialog::GetSelectedRadioButtonID

Возвращает выбранную переключатель.

int GetSelectedRadioButtonID() const;

Возвращаемое значение

Идентификатор выбранной переключателя.

Замечания

Этот метод можно использовать после закрытия диалогового окна, чтобы получить выбранную переключатель.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

taskDialog.AddRadioButton(201, L"First option");
taskDialog.AddRadioButton(202, L"Second option");
taskDialog.AddRadioButton(203, L"Third option");

taskDialog.DoModal();
int selection = taskDialog.GetSelectedRadioButtonID();

switch (selection)
{
case 201:
   // TODO: Place processing here for the first
   // radio button.
   break;

case 202:
   // TODO: Place processing here for the second
   // radio button.
   break;

case 203:
   // TODO: Place processing here for the third
   // radio button.
   break;

default:
   break;
}

// Remove all the radio buttons so that we can use the same task
// dialog with new radio buttons.
taskDialog.RemoveAllRadioButtons();

taskDialog.AddRadioButton(301, L"New first option");
taskDialog.AddRadioButton(302, L"New second option");
taskDialog.AddRadioButton(303,
                          L"New third option should be disabled");

// Change the default radio button to the second option
taskDialog.SetDefaultRadioButton(302);

// Make sure the third option is disabled.
if (taskDialog.IsRadioButtonEnabled(303))
{
   taskDialog.SetRadioButtonOptions(303, FALSE);
}

taskDialog.DoModal();
selection = taskDialog.GetSelectedRadioButtonID();

switch (taskDialog.GetSelectedRadioButtonID())
{
case 301:
   // TODO: Place processing here for new first
   // command button control.
   break;

case 302:
   // TODO: Place processing here for new second
   // command button control.
   break;

case 303:
   // TODO: Place processing here for the new third
   // command button control.
   break;

default:
   break;
}

// Remove all the radio button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllRadioButtons();
taskDialog.LoadRadioButtons(1001, 1005);

CTaskDialog::GetVerificationCheckboxState

Извлекает состояние поля проверки проверка.

BOOL GetVerificationCheckboxState() const;

Возвращаемое значение

Значение TRUE, если поле проверка проверка, значение FALSE, если это не так.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

// Add the verification checkbox and set the default state.
taskDialog.SetVerificationCheckboxText(L"Remember your selection.");
taskDialog.SetVerificationCheckbox(false);

taskDialog.DoModal();

if (taskDialog.GetVerificationCheckboxState())
{
   // TODO: Write settings of the task dialog to the registry
}

CTaskDialog::IsCommandControlEnabled

Определяет, включена ли элемент управления кнопкой или кнопка.

BOOL IsCommandControlEnabled(int nCommandControlID) const;

Параметры

nCommandControlID
[in] Идентификатор элемента управления кнопки командной кнопки или кнопки для тестирования.

Возвращаемое значение

ЗНАЧЕНИЕ TRUE, если элемент управления включен, значение FALSE, если оно отсутствует.

Замечания

Этот метод можно использовать для определения доступности элементов управления кнопками команд и общих CTaskDialog кнопок класса*.

Если nCommandControlID не является допустимым идентификатором для общей CTaskDialog кнопки или элемента управления кнопкой команды, этот метод вызывает исключение.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title.
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

taskDialog.AddCommandControl(201, L"First command button control");
taskDialog.AddCommandControl(202, L"Second command button control");
taskDialog.AddCommandControl(203, L"Third command button control");

// Show the CTaskDialog and remember how the user closed it.
int selection = taskDialog.DoModal();

switch (selection)
{
case 201:
   // TODO: Place processing here for the first
   // command button control.
   break;

case 202:
   // TODO: Place processing here for the second
   // command button control.
   break;

case 203:
   // TODO: Place processing here for the third
   // command button control.
   break;

default:
   break;
}

// Remove all the command controls so that we can use the same task
// dialog with new command button controls.
taskDialog.RemoveAllCommandControls();

taskDialog.AddCommandControl(301,
                             L"New first command button control");
taskDialog.AddCommandControl(302,
                             L"New second command button control should require elevation",
                             TRUE, TRUE);
taskDialog.AddCommandControl(303,
                             L"New third command button control should be disabled");

// Change the default command button control
taskDialog.SetDefaultCommandControl(302);

// Make sure the third option is disabled.
if (taskDialog.IsCommandControlEnabled(303))
{
   taskDialog.SetCommandControlOptions(303, FALSE);
}

taskDialog.DoModal();

switch (taskDialog.GetSelectedCommandControlID())
{
case 301:
   // TODO: Place processing here for new first
   // command button control.
   break;

case 302:
   // TODO: Place processing here for new second
   // command button control.
   break;

case 303:
   // TODO: Place processing here for the new third
   // command button control.
   break;

default:
   break;
}

// Remove all the command button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllCommandControls();
taskDialog.LoadCommandControls(1001, 1005);

CTaskDialog::IsRadioButtonEnabled

Определяет, включена ли переключатель.

BOOL IsRadioButtonEnabled(int nRadioButtonID) const;

Параметры

nRadioButtonID
[in] Идентификатор проверяемой переключателя.

Возвращаемое значение

ЗНАЧЕНИЕ TRUE, если переключатель включен, значение FALSE, если оно отсутствует.

Замечания

Если nRadioButtonID не является допустимым идентификатором переключателя, этот метод вызывает исключение.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

taskDialog.AddRadioButton(201, L"First option");
taskDialog.AddRadioButton(202, L"Second option");
taskDialog.AddRadioButton(203, L"Third option");

taskDialog.DoModal();
int selection = taskDialog.GetSelectedRadioButtonID();

switch (selection)
{
case 201:
   // TODO: Place processing here for the first
   // radio button.
   break;

case 202:
   // TODO: Place processing here for the second
   // radio button.
   break;

case 203:
   // TODO: Place processing here for the third
   // radio button.
   break;

default:
   break;
}

// Remove all the radio buttons so that we can use the same task
// dialog with new radio buttons.
taskDialog.RemoveAllRadioButtons();

taskDialog.AddRadioButton(301, L"New first option");
taskDialog.AddRadioButton(302, L"New second option");
taskDialog.AddRadioButton(303,
                          L"New third option should be disabled");

// Change the default radio button to the second option
taskDialog.SetDefaultRadioButton(302);

// Make sure the third option is disabled.
if (taskDialog.IsRadioButtonEnabled(303))
{
   taskDialog.SetRadioButtonOptions(303, FALSE);
}

taskDialog.DoModal();
selection = taskDialog.GetSelectedRadioButtonID();

switch (taskDialog.GetSelectedRadioButtonID())
{
case 301:
   // TODO: Place processing here for new first
   // command button control.
   break;

case 302:
   // TODO: Place processing here for new second
   // command button control.
   break;

case 303:
   // TODO: Place processing here for the new third
   // command button control.
   break;

default:
   break;
}

// Remove all the radio button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllRadioButtons();
taskDialog.LoadRadioButtons(1001, 1005);

CTaskDialog::IsSupported

Определяет, поддерживает CTaskDialogли компьютер, на котором запущено приложение.

static BOOL IsSupported();

Возвращаемое значение

ЗНАЧЕНИЕ TRUE, если компьютер поддерживает ; CTaskDialog Значение FALSE в противном случае.

Замечания

Используйте эту функцию для определения во время выполнения, если компьютер, на котором запущено приложение, поддерживает CTaskDialog класс. Если компьютер не поддерживает CTaskDialogэту функцию, следует предоставить другой метод обмена данными с пользователем. Приложение завершится сбоем, если он пытается использовать CTaskDialog на компьютере, который не поддерживает CTaskDialog класс.

Пример

// 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);
}

CTaskDialog::LoadCommandControls

Добавляет элементы управления кнопкой команды с помощью данных из строковой таблицы.

void LoadCommandControls(
    int nIDCommandControlsFirst,
    int nIDCommandControlsLast);

Параметры

nIDCommandControlsFirst
[in] Строковый идентификатор первой команды.

nIDCommandControlsLast
[in] Строковый идентификатор последней команды.

Замечания

Этот метод создает элементы управления кнопкой команд с помощью данных из файла ресурсов приложения. Таблица строк в файле ресурсов содержит несколько строк с связанными идентификаторами строк. Новые элементы управления кнопкой команд, добавленные с помощью этого метода, используют строку для подпись элемента управления и идентификатор строки для идентификатора элемента управления. Выбранный диапазон строк предоставляется nIDCommandControlsFirst и nCommandControlsLast включительно. Если в диапазоне есть пустая запись, метод не добавляет элемент управления кнопкой командной строки для этой записи.

По умолчанию новые элементы управления кнопкой команд включены и не требуют повышения прав.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title.
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

taskDialog.AddCommandControl(201, L"First command button control");
taskDialog.AddCommandControl(202, L"Second command button control");
taskDialog.AddCommandControl(203, L"Third command button control");

// Show the CTaskDialog and remember how the user closed it.
int selection = taskDialog.DoModal();

switch (selection)
{
case 201:
   // TODO: Place processing here for the first
   // command button control.
   break;

case 202:
   // TODO: Place processing here for the second
   // command button control.
   break;

case 203:
   // TODO: Place processing here for the third
   // command button control.
   break;

default:
   break;
}

// Remove all the command controls so that we can use the same task
// dialog with new command button controls.
taskDialog.RemoveAllCommandControls();

taskDialog.AddCommandControl(301,
                             L"New first command button control");
taskDialog.AddCommandControl(302,
                             L"New second command button control should require elevation",
                             TRUE, TRUE);
taskDialog.AddCommandControl(303,
                             L"New third command button control should be disabled");

// Change the default command button control
taskDialog.SetDefaultCommandControl(302);

// Make sure the third option is disabled.
if (taskDialog.IsCommandControlEnabled(303))
{
   taskDialog.SetCommandControlOptions(303, FALSE);
}

taskDialog.DoModal();

switch (taskDialog.GetSelectedCommandControlID())
{
case 301:
   // TODO: Place processing here for new first
   // command button control.
   break;

case 302:
   // TODO: Place processing here for new second
   // command button control.
   break;

case 303:
   // TODO: Place processing here for the new third
   // command button control.
   break;

default:
   break;
}

// Remove all the command button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllCommandControls();
taskDialog.LoadCommandControls(1001, 1005);

CTaskDialog::LoadRadioButtons

Добавляет элементы управления переключателем с помощью данных из строковой таблицы.

void LoadRadioButtons(
    int nIDRadioButtonsFirst,
    int nIDRadioButtonsLast);

Параметры

nIDRadioButtonsFirst
[in] Идентификатор строки первой переключателя.

nIDRadioButtonsLast
[in] Идентификатор строки последней переключателя.

Замечания

Этот метод создает переключатели с помощью данных из файла ресурсов приложения. Таблица строк в файле ресурсов содержит несколько строк с связанными идентификаторами строк. Новые переключатели, добавленные с помощью этого метода, используют строку для подпись переключателя и идентификатор строки для идентификатора переключателя. Выбранный диапазон строк предоставляется nIDRadioButtonsFirst и nRadioButtonsLast включительно. Если в диапазоне есть пустая запись, метод не добавляет переключатель для этой записи.

По умолчанию включены новые переключатели.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

taskDialog.AddRadioButton(201, L"First option");
taskDialog.AddRadioButton(202, L"Second option");
taskDialog.AddRadioButton(203, L"Third option");

taskDialog.DoModal();
int selection = taskDialog.GetSelectedRadioButtonID();

switch (selection)
{
case 201:
   // TODO: Place processing here for the first
   // radio button.
   break;

case 202:
   // TODO: Place processing here for the second
   // radio button.
   break;

case 203:
   // TODO: Place processing here for the third
   // radio button.
   break;

default:
   break;
}

// Remove all the radio buttons so that we can use the same task
// dialog with new radio buttons.
taskDialog.RemoveAllRadioButtons();

taskDialog.AddRadioButton(301, L"New first option");
taskDialog.AddRadioButton(302, L"New second option");
taskDialog.AddRadioButton(303,
                          L"New third option should be disabled");

// Change the default radio button to the second option
taskDialog.SetDefaultRadioButton(302);

// Make sure the third option is disabled.
if (taskDialog.IsRadioButtonEnabled(303))
{
   taskDialog.SetRadioButtonOptions(303, FALSE);
}

taskDialog.DoModal();
selection = taskDialog.GetSelectedRadioButtonID();

switch (taskDialog.GetSelectedRadioButtonID())
{
case 301:
   // TODO: Place processing here for new first
   // command button control.
   break;

case 302:
   // TODO: Place processing here for new second
   // command button control.
   break;

case 303:
   // TODO: Place processing here for the new third
   // command button control.
   break;

default:
   break;
}

// Remove all the radio button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllRadioButtons();
taskDialog.LoadRadioButtons(1001, 1005);

Передает фокус другому CTaskDialog.

protected:
void NavigateTo(CTaskDialog& oTaskDialog) const;

Параметры

oTaskDialog
[in] Объект CTaskDialog , который получает фокус.

Замечания

Этот метод скрывает текущий CTaskDialog при отображении oTaskDialog. Объект oTaskDialog отображается в том же расположении, что и текущий CTaskDialog.

CTaskDialog::OnCommandControlClick

Платформа вызывает этот метод, когда пользователь щелкает элемент управления кнопкой командной кнопки.

virtual HRESULT OnCommandControlClick(int nCommandControlID);

Параметры

nCommandControlID
[in] Идентификатор элемента управления кнопки команды, выбранного пользователем.

Возвращаемое значение

Реализация по умолчанию возвращает S_OK.

Замечания

Переопределите этот метод в производном классе для реализации пользовательского поведения.

CTaskDialog::OnCreate

Платформа вызывает этот метод после создания CTaskDialog.

virtual HRESULT OnCreate();

Возвращаемое значение

Реализация по умолчанию возвращает S_OK.

Замечания

Переопределите этот метод в производном классе для реализации пользовательского поведения.

CTaskDialog::OnDeskDialog

Платформа вызывает этот метод непосредственно перед его уничтожением CTaskDialog.

virtual HRESULT OnDestroy();

Возвращаемое значение

Реализация по умолчанию возвращает S_OK.

Замечания

Переопределите этот метод в производном классе для реализации пользовательского поведения.

CTaskDialog::OnExpandButtonClick

Платформа вызывает этот метод, когда пользователь нажимает кнопку расширения.

virtual HRESULT OnExpandButtonClicked(BOOL bExpanded);

Параметры

bExpanded
[in] Значение, отличное от нуля, указывает, что отображаются дополнительные сведения; 0 указывает, что дополнительная информация скрыта.

Возвращаемое значение

Реализация по умолчанию возвращает S_OK.

Замечания

Переопределите этот метод в производном классе для реализации пользовательского поведения.

CTaskDialog::OnHelp

Платформа вызывает этот метод, когда пользователь запрашивает справку.

virtual HRESULT OnHelp();

Возвращаемое значение

Реализация по умолчанию возвращает S_OK.

Замечания

Переопределите этот метод в производном классе для реализации пользовательского поведения.

CTaskDialog::OnHyperlinkClick

Платформа вызывает этот метод, когда пользователь щелкает гиперссылку.

virtual HRESULT OnHyperlinkClick(const CString& strHref);

Параметры

strHref
[in] Строка, представляющая гиперссылку.

Возвращаемое значение

Реализация по умолчанию возвращает S_OK.

Замечания

Этот метод вызывает ShellExecute , прежде чем он возвращает S_OK.

Переопределите этот метод в производном классе для реализации пользовательского поведения.

CTaskDialog::OnInit

Платформа вызывает этот метод при CTaskDialog инициализации.

virtual HRESULT OnInit();

Возвращаемое значение

Реализация по умолчанию возвращает S_OK.

Замечания

Переопределите этот метод в производном классе для реализации пользовательского поведения.

CTaskDialog::OnNavigatePage

Платформа вызывает этот метод в ответ на метод CTaskDialog::NavigateTo .

virtual HRESULT OnNavigatePage();

Возвращаемое значение

Реализация по умолчанию возвращает S_OK.

Замечания

Переопределите этот метод в производном классе для реализации пользовательского поведения.

CTaskDialog::OnRadioButtonClick

Платформа вызывает этот метод, когда пользователь выбирает элемент управления переключателем.

virtual HRESULT OnRadioButtonClick(int nRadioButtonID);

Параметры

nRadioButtonID
[in] Идентификатор элемента управления переключателем, который пользователь щелкнул.

Возвращаемое значение

Реализация по умолчанию возвращает S_OK.

Замечания

Переопределите этот метод в производном классе для реализации пользовательского поведения.

CTaskDialog::OnTimer

Платформа вызывает этот метод при истечении срока действия таймера.

virtual HRESULT OnTimer(long lTime);

Параметры

lTime
[in] Время в миллисекундах после CTaskDialog создания или сброса таймера.

Возвращаемое значение

Реализация по умолчанию возвращает S_OK.

Замечания

Переопределите этот метод в производном классе для реализации пользовательского поведения.

CTaskDialog::OnVerificationCheckboxClick

Платформа вызывает этот метод, когда пользователь щелкает поле проверки проверка.

virtual HRESULT OnVerificationCheckboxClick(BOOL bChecked);

Параметры

bChecked
[in] ЗНАЧЕНИЕ TRUE указывает, что выбрано поле проверки проверка; FALSE указывает, что это не так.

Возвращаемое значение

Реализация по умолчанию возвращает S_OK.

Замечания

Переопределите этот метод в производном классе для реализации пользовательского поведения.

CTaskDialog::RemoveAllCommandControls

Удаляет все элементы управления кнопкой команды из элемента CTaskDialogуправления .

void RemoveAllCommandControls();

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title.
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

taskDialog.AddCommandControl(201, L"First command button control");
taskDialog.AddCommandControl(202, L"Second command button control");
taskDialog.AddCommandControl(203, L"Third command button control");

// Show the CTaskDialog and remember how the user closed it.
int selection = taskDialog.DoModal();

switch (selection)
{
case 201:
   // TODO: Place processing here for the first
   // command button control.
   break;

case 202:
   // TODO: Place processing here for the second
   // command button control.
   break;

case 203:
   // TODO: Place processing here for the third
   // command button control.
   break;

default:
   break;
}

// Remove all the command controls so that we can use the same task
// dialog with new command button controls.
taskDialog.RemoveAllCommandControls();

taskDialog.AddCommandControl(301,
                             L"New first command button control");
taskDialog.AddCommandControl(302,
                             L"New second command button control should require elevation",
                             TRUE, TRUE);
taskDialog.AddCommandControl(303,
                             L"New third command button control should be disabled");

// Change the default command button control
taskDialog.SetDefaultCommandControl(302);

// Make sure the third option is disabled.
if (taskDialog.IsCommandControlEnabled(303))
{
   taskDialog.SetCommandControlOptions(303, FALSE);
}

taskDialog.DoModal();

switch (taskDialog.GetSelectedCommandControlID())
{
case 301:
   // TODO: Place processing here for new first
   // command button control.
   break;

case 302:
   // TODO: Place processing here for new second
   // command button control.
   break;

case 303:
   // TODO: Place processing here for the new third
   // command button control.
   break;

default:
   break;
}

// Remove all the command button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllCommandControls();
taskDialog.LoadCommandControls(1001, 1005);

CTaskDialog::RemoveAllRadioButtons

Удаляет все переключатели из переключателя CTaskDialog.

void RemoveAllRadioButtons();

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

taskDialog.AddRadioButton(201, L"First option");
taskDialog.AddRadioButton(202, L"Second option");
taskDialog.AddRadioButton(203, L"Third option");

taskDialog.DoModal();
int selection = taskDialog.GetSelectedRadioButtonID();

switch (selection)
{
case 201:
   // TODO: Place processing here for the first
   // radio button.
   break;

case 202:
   // TODO: Place processing here for the second
   // radio button.
   break;

case 203:
   // TODO: Place processing here for the third
   // radio button.
   break;

default:
   break;
}

// Remove all the radio buttons so that we can use the same task
// dialog with new radio buttons.
taskDialog.RemoveAllRadioButtons();

taskDialog.AddRadioButton(301, L"New first option");
taskDialog.AddRadioButton(302, L"New second option");
taskDialog.AddRadioButton(303,
                          L"New third option should be disabled");

// Change the default radio button to the second option
taskDialog.SetDefaultRadioButton(302);

// Make sure the third option is disabled.
if (taskDialog.IsRadioButtonEnabled(303))
{
   taskDialog.SetRadioButtonOptions(303, FALSE);
}

taskDialog.DoModal();
selection = taskDialog.GetSelectedRadioButtonID();

switch (taskDialog.GetSelectedRadioButtonID())
{
case 301:
   // TODO: Place processing here for new first
   // command button control.
   break;

case 302:
   // TODO: Place processing here for new second
   // command button control.
   break;

case 303:
   // TODO: Place processing here for the new third
   // command button control.
   break;

default:
   break;
}

// Remove all the radio button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllRadioButtons();
taskDialog.LoadRadioButtons(1001, 1005);

CTaskDialog::SetCommandControlOptions

Обновления элемент управления кнопкой командной кнопки в элементе CTaskDialogуправления .

void SetCommandControlOptions(
    int nCommandControlID,
    BOOL bEnabled,
    BOOL bRequiresElevation = FALSE);

Параметры

nCommandControlID
[in] Идентификатор элемента управления командой для обновления.

bEnabled
[in] Логический параметр, указывающий, включена ли или отключена указанная элемент управления кнопкой командной строки.

bRequiresElevation
[in] Логический параметр, указывающий, требуется ли для указанного элемента управления кнопкой командной кнопки повышение прав.

Замечания

Используйте этот метод, чтобы изменить, включен ли элемент управления кнопкой командной кнопки или требуется повышение прав после добавления в CTaskDialog класс.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title.
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

taskDialog.AddCommandControl(201, L"First command button control");
taskDialog.AddCommandControl(202, L"Second command button control");
taskDialog.AddCommandControl(203, L"Third command button control");

// Show the CTaskDialog and remember how the user closed it.
int selection = taskDialog.DoModal();

switch (selection)
{
case 201:
   // TODO: Place processing here for the first
   // command button control.
   break;

case 202:
   // TODO: Place processing here for the second
   // command button control.
   break;

case 203:
   // TODO: Place processing here for the third
   // command button control.
   break;

default:
   break;
}

// Remove all the command controls so that we can use the same task
// dialog with new command button controls.
taskDialog.RemoveAllCommandControls();

taskDialog.AddCommandControl(301,
                             L"New first command button control");
taskDialog.AddCommandControl(302,
                             L"New second command button control should require elevation",
                             TRUE, TRUE);
taskDialog.AddCommandControl(303,
                             L"New third command button control should be disabled");

// Change the default command button control
taskDialog.SetDefaultCommandControl(302);

// Make sure the third option is disabled.
if (taskDialog.IsCommandControlEnabled(303))
{
   taskDialog.SetCommandControlOptions(303, FALSE);
}

taskDialog.DoModal();

switch (taskDialog.GetSelectedCommandControlID())
{
case 301:
   // TODO: Place processing here for new first
   // command button control.
   break;

case 302:
   // TODO: Place processing here for new second
   // command button control.
   break;

case 303:
   // TODO: Place processing here for the new third
   // command button control.
   break;

default:
   break;
}

// Remove all the command button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllCommandControls();
taskDialog.LoadCommandControls(1001, 1005);

CTaskDialog::SetCommonButtonOptions

Обновления подмножество распространенных кнопок, которые необходимо включить и требовать повышение прав пользователей.

void SetCommonButtonOptions(
    int nDisabledButtonMask,
    int nElevationButtonMask = 0);

Параметры

nDisabledButtonMask
[in] Маска для общих кнопок, отключаемая.

nElevationButtonMask
[in] Маска для общих кнопок, требующих повышения прав.

Замечания

Общие кнопки, доступные для экземпляра класса CTaskDialog, можно задать с помощью конструктора CTaskDialog::CTaskDialog и метода CTaskDialog::SetCommonButtons. CTaskDialog::SetCommonButtonOptions не поддерживает добавление новых общих кнопок.

Если этот метод используется для отключения или повышения общего кнопки, недоступной для этого CTaskDialog, этот метод создает исключение с помощью макроса ENSURE .

Этот метод включает любую кнопку, доступную CTaskDialog для нее, но не в nDisabledButtonMask, даже если она была отключена ранее. Этот метод обрабатывает повышение прав таким же образом: он записывает общие кнопки, так как не требует повышения, если общая кнопка доступна, но не включена в nElevationButtonMask.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title);

// Create a button mask.
int buttons = TDCBF_OK_BUTTON | TDCBF_CANCEL_BUTTON;
buttons |= TDCBF_RETRY_BUTTON | TDCBF_CLOSE_BUTTON;

taskDialog.SetCommonButtons(buttons);

// Disable the close button and make the retry button require
// elevation.
taskDialog.SetCommonButtonOptions(TDCBF_CLOSE_BUTTON,
                                  TDCBF_RETRY_BUTTON);

taskDialog.DoModal();

CTaskDialog::SetCommonButtons

Добавляет общие кнопки в CTaskDialog.

void SetCommonButtons(
    int nButtonMask,
    int nDisabledButtonMask = 0,
    int nElevationButtonMask = 0);

Параметры

nButtonMask
[in] Маска кнопок, добавляемых в CTaskDialog.

nDisabledButtonMask
[in] Маска кнопок, отключаемая.

nElevationButtonMask
[in] Маска кнопок, требующих повышения прав.

Замечания

Этот метод нельзя вызвать после создания окна отображения для этого экземпляра CTaskDialog класса. При этом метод вызывает исключение.

Кнопки, указанные nButtonMask, переопределяют все распространенные кнопки, добавленные ранее в .CTaskDialog Доступны только кнопки, указанные в nButtonMask .

Если nDisabledButtonMask или nElevationButtonMask содержат кнопку, которая не находится в nButtonMask, этот метод создает исключение с помощью макроса ENSURE.

По умолчанию все общие кнопки включены и не требуют повышения прав.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title);

// Create a button mask.
int buttons = TDCBF_OK_BUTTON | TDCBF_CANCEL_BUTTON;
buttons |= TDCBF_RETRY_BUTTON | TDCBF_CLOSE_BUTTON;

taskDialog.SetCommonButtons(buttons);

// Disable the close button and make the retry button require
// elevation.
taskDialog.SetCommonButtonOptions(TDCBF_CLOSE_BUTTON,
                                  TDCBF_RETRY_BUTTON);

taskDialog.DoModal();

CTaskDialog::SetContent

Обновления содержимое CTaskDialogобъекта .

void SetContent(const CString& strContent);

Параметры

strContent
[in] Строка, отображаемая пользователю.

Замечания

Содержимое CTaskDialog класса — это текст, отображаемый пользователю в главном разделе диалогового окна.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);

// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);

// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
                            L"Click here for more information.",
                            L"Click here to hide the extra information.");

// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);

taskDialog.DoModal();

CTaskDialog::SetDefaultCommandControl

Задает элемент управления командной кнопкой по умолчанию.

void SetDefaultCommandControl(int nCommandControlID);

Параметры

nCommandControlID
[in] Идентификатор элемента управления "Кнопка команды", который будет использоваться по умолчанию.

Замечания

Элемент управления командной кнопкой по умолчанию — это элемент управления, выбранный при CTaskDialog первом отображении пользователю.

Этот метод создает исключение, если не удается найти элемент управления кнопкой команд, указанный nCommandControlID.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title.
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

taskDialog.AddCommandControl(201, L"First command button control");
taskDialog.AddCommandControl(202, L"Second command button control");
taskDialog.AddCommandControl(203, L"Third command button control");

// Show the CTaskDialog and remember how the user closed it.
int selection = taskDialog.DoModal();

switch (selection)
{
case 201:
   // TODO: Place processing here for the first
   // command button control.
   break;

case 202:
   // TODO: Place processing here for the second
   // command button control.
   break;

case 203:
   // TODO: Place processing here for the third
   // command button control.
   break;

default:
   break;
}

// Remove all the command controls so that we can use the same task
// dialog with new command button controls.
taskDialog.RemoveAllCommandControls();

taskDialog.AddCommandControl(301,
                             L"New first command button control");
taskDialog.AddCommandControl(302,
                             L"New second command button control should require elevation",
                             TRUE, TRUE);
taskDialog.AddCommandControl(303,
                             L"New third command button control should be disabled");

// Change the default command button control
taskDialog.SetDefaultCommandControl(302);

// Make sure the third option is disabled.
if (taskDialog.IsCommandControlEnabled(303))
{
   taskDialog.SetCommandControlOptions(303, FALSE);
}

taskDialog.DoModal();

switch (taskDialog.GetSelectedCommandControlID())
{
case 301:
   // TODO: Place processing here for new first
   // command button control.
   break;

case 302:
   // TODO: Place processing here for new second
   // command button control.
   break;

case 303:
   // TODO: Place processing here for the new third
   // command button control.
   break;

default:
   break;
}

// Remove all the command button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllCommandControls();
taskDialog.LoadCommandControls(1001, 1005);

CTaskDialog::SetDefaultRadioButton

Задает переключатель по умолчанию.

void SetDefaultRadioButton(int nRadioButtonID);

Параметры

nRadioButtonID
[in] Идентификатор переключателя, который будет использоваться по умолчанию.

Замечания

Переключатель по умолчанию — это кнопка, выбранная при CTaskDialog первом отображении пользователю.

Этот метод создает исключение, если не удается найти переключатель, указанный nRadioButtonID.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

taskDialog.AddRadioButton(201, L"First option");
taskDialog.AddRadioButton(202, L"Second option");
taskDialog.AddRadioButton(203, L"Third option");

taskDialog.DoModal();
int selection = taskDialog.GetSelectedRadioButtonID();

switch (selection)
{
case 201:
   // TODO: Place processing here for the first
   // radio button.
   break;

case 202:
   // TODO: Place processing here for the second
   // radio button.
   break;

case 203:
   // TODO: Place processing here for the third
   // radio button.
   break;

default:
   break;
}

// Remove all the radio buttons so that we can use the same task
// dialog with new radio buttons.
taskDialog.RemoveAllRadioButtons();

taskDialog.AddRadioButton(301, L"New first option");
taskDialog.AddRadioButton(302, L"New second option");
taskDialog.AddRadioButton(303,
                          L"New third option should be disabled");

// Change the default radio button to the second option
taskDialog.SetDefaultRadioButton(302);

// Make sure the third option is disabled.
if (taskDialog.IsRadioButtonEnabled(303))
{
   taskDialog.SetRadioButtonOptions(303, FALSE);
}

taskDialog.DoModal();
selection = taskDialog.GetSelectedRadioButtonID();

switch (taskDialog.GetSelectedRadioButtonID())
{
case 301:
   // TODO: Place processing here for new first
   // command button control.
   break;

case 302:
   // TODO: Place processing here for new second
   // command button control.
   break;

case 303:
   // TODO: Place processing here for the new third
   // command button control.
   break;

default:
   break;
}

// Remove all the radio button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllRadioButtons();
taskDialog.LoadRadioButtons(1001, 1005);

CTaskDialog::SetDialogWidth

Настраивает ширину CTaskDialogэлемента .

void SetDialogWidth(int nWidth = 0);

Параметры

nWidth
[in] Ширина диалогового окна в пикселях.

Замечания

Параметр nWidth должен быть больше или равен 0. В противном случае этот метод создает исключение.

Если для nWidth задано значение 0, этот метод задает диалоговое окно для размера по умолчанию.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);

// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);

// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
                            L"Click here for more information.",
                            L"Click here to hide the extra information.");

// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);

taskDialog.DoModal();

CTaskDialog::SetExpansionArea

Обновления область CTaskDialogрасширения .

void SetExpansionArea(
    const CString& strExpandedInformation,
    const CString& strCollapsedLabel = _T(""),
    const CString& strExpandedLabel = _T(""));

Параметры

strExpandedInformation
[in] Строка, CTaskDialog отображаемая в основном тексте диалогового окна, когда пользователь нажимает кнопку расширения.

strCollapsedLabel
[in] Строка, CTaskDialog отображаемая рядом с кнопкой расширения при свернутой развернутой области.

strExpandedLabel
[in] Строка, CTaskDialog отображаемая рядом с кнопкой расширения при отображении развернутой области.

Замечания

Область расширения CTaskDialog класса позволяет предоставить пользователю дополнительные сведения. Область расширения находится в основной части CTaskDialog, расположенной сразу под строкой заголовка и содержимого.

CTaskDialog При первом отображении он не отображает развернутую информацию и помещает strCollapsedLabel рядом с кнопкой расширения. Когда пользователь нажимает кнопку расширения, CTaskDialog отображает strExpandedInformation и изменяет метку на strExpandedLabel.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);

// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);

// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
                            L"Click here for more information.",
                            L"Click here to hide the extra information.");

// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);

taskDialog.DoModal();

CTaskDialog::SetFooterIcon

Обновления значок нижнего CTaskDialogколонтитула .

void SetFooterIcon(HICON hFooterIcon);
void SetFooterIcon(LPCWSTR lpszFooterIcon);

Параметры

hFooterIcon
[in] Новый значок для CTaskDialog.

lpszFooterIcon
[in] Новый значок для CTaskDialog.

Замечания

Значок нижнего колонтитула отображается в нижней части класса CTaskDialog. Он может иметь связанный текст нижнего колонтитула. Текст нижнего колонтитула можно изменить с помощью CTaskDialog::SetFooterText.

Этот метод создает исключение с макросом ENSURE , если CTaskDialog отображается или входной параметр имеет значение NULL.

Может CTaskDialog принимать HICONLPCWSTR только значок нижнего колонтитула. Это настраивается, задав параметр TDF_USE_HICON_FOOTER в конструкторе или CTaskDialog::SetOptions. По умолчанию CTaskDialog для значка нижнего колонтитула настроено использование LPCWSTR в качестве входного типа. Этот метод создает исключение, если вы пытаетесь задать значок с помощью недопустимого типа.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);

// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);

// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
                            L"Click here for more information.",
                            L"Click here to hide the extra information.");

// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);

taskDialog.DoModal();

CTaskDialog::SetFooterText

Обновления текст в нижнем колонтитулеCTaskDialog.

void SetFooterText(const CString& strFooterText);

Параметры

strFooterText
[in] Новый текст нижнего колонтитула.

Замечания

Значок нижнего колонтитула отображается рядом с текстом нижнего колонтитула в нижней CTaskDialogчасти. Значок нижнего колонтитула можно изменить с помощью CTaskDialog::SetFooterIcon.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);

// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);

// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
                            L"Click here for more information.",
                            L"Click here to hide the extra information.");

// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);

taskDialog.DoModal();

CTaskDialog::SetMainIcon

Обновления главный значок элемента CTaskDialog.

void SetMainIcon(HICON hMainIcon);
void SetMainIcon(LPCWSTR lpszMainIcon);

Параметры

hMainIcon
[in] Новый значок.

lpszMainIcon
[in] Новый значок.

Замечания

Этот метод создает исключение с макросом ENSURE , если CTaskDialog отображается или входной параметр имеет значение NULL.

Может CTaskDialog принимать HICON только значок или LPCWSTR как главный значок. Это можно настроить, задав параметр TDF_USE_HICON_MAIN в конструкторе или в методе CTaskDialog::SetOptions . По умолчанию CTaskDialog для основного значка настроено использование LPCWSTR в качестве входного типа. Этот метод создает исключение, если вы пытаетесь задать значок с помощью недопустимого типа.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);

// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);

// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
                            L"Click here for more information.",
                            L"Click here to hide the extra information.");

// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);

taskDialog.DoModal();

CTaskDialog::SetMainInstruction

Обновления основную инструкцию CTaskDialog.

void SetMainInstruction(const CString& strInstructions);

Параметры

strInstructions
[in] Новая основная инструкция.

Замечания

Основная инструкция CTaskDialog класса — текст, отображаемый пользователю в большом полужирном шрифте. Он находится в диалоговом окне под заголовком строки.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);

// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);

// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
                            L"Click here for more information.",
                            L"Click here to hide the extra information.");

// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);

taskDialog.DoModal();

CTaskDialog::SetOptions

Настраивает параметры для CTaskDialog.

void SetOptions(int nOptionFlag);

Параметры

nOptionFlag
[in] Набор флагов, используемых для CTaskDialogобъекта .

Замечания

Этот метод очищает все текущие параметры для CTaskDialogпараметра . Чтобы сохранить текущие параметры, необходимо сначала извлечь их с помощью CTaskDialog::GetOptions и объединить их с параметрами, которые необходимо задать.

В следующей таблице перечислены все допустимые параметры.

Имя Описание
TDF_ENABLE_HYPERLINKS Включает гиперссылки в элементе CTaskDialog.
TDF_USE_HICON_MAIN Настраивает CTaskDialog использование основного HICON значка. Альтернативой является использование LPCWSTR.
TDF_USE_HICON_FOOTER Настраивает CTaskDialog использование значка HICON нижнего колонтитула. Альтернативой является использование LPCWSTR.
TDF_ALLOW_DIALOG_CANCELLATION Позволяет пользователю закрыть CTaskDialog его с помощью клавиатуры или с помощью значка в правом верхнем углу диалогового окна, даже если кнопка "Отмена " не включена. Если этот флаг не задан, и кнопка "Отмена " не включена, пользователь не может закрыть диалоговое окно с помощью alt+F4, клавиши Escape или кнопки закрытия заголовка.
TDF_USE_COMMAND_LINKS Настраивает элементы управления кнопкой командной CTaskDialog строки.
TDF_USE_COMMAND_LINKS_NO_ICON Настраивает CTaskDialog элементы управления командой без отображения значка рядом с элементом управления. TDF_USE_COMMAND_LINKS переопределяет TDF_USE_COMMAND_LINKS_NO_ICON.
TDF_EXPAND_FOOTER_AREA Указывает, что область расширения в настоящее время развернута.
TDF_EXPANDED_BY_DEFAULT Определяет, развернута ли область расширения по умолчанию.
TDF_VERIFICATION_FLAG_CHECKED Указывает, что выбрано поле проверка проверки.
TDF_SHOW_PROGRESS_BAR Настраивает CTaskDialog отображение индикатора выполнения.
TDF_SHOW_MARQUEE_PROGRESS_BAR Настраивает индикатор хода выполнения в виде индикатора выполнения. Если этот параметр включен, необходимо задать TDF_SHOW_PROGRESS_BAR ожидаемое поведение.
TDF_CALLBACK_TIMER Указывает, что CTaskDialog интервал обратного вызова равен примерно 200 миллисекундам.
TDF_POSITION_RELATIVE_TO_WINDOW Настраивает CTaskDialog центрирование относительно родительского окна. Если этот флаг не включен, CTaskDialog центрируется относительно монитора.
TDF_RTL_LAYOUT Настраивает CTaskDialog макет чтения справа налево.
TDF_NO_DEFAULT_RADIO_BUTTON Указывает, что переключатель не выбран при CTaskDialog появлении.
TDF_CAN_BE_MINIMIZED Позволяет пользователю свести к минимуму CTaskDialogчисло. Для поддержки этого параметра CTaskDialog не может быть модальным. MFC не поддерживает этот параметр, так как MFC не поддерживает режимный CTaskDialogрежим.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);

// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);

// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
                            L"Click here for more information.",
                            L"Click here to hide the extra information.");

// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);

taskDialog.DoModal();

CTaskDialog::SetProgressBarMarquee

Настраивает панель маркирования для окна CTaskDialog и добавляет ее в диалоговое окно.

void SetProgressBarMarquee(
    BOOL bEnabled = TRUE,
    int nMarqueeSpeed = 0);

Параметры

bEnabled
[in] ЗНАЧЕНИЕ TRUE, чтобы включить панель marquee; ЗНАЧЕНИЕ FALSE, чтобы отключить панель марке и удалить ее из CTaskDialog.

nMarqueeSpeed
[in] Целое число, указывающее скорость панели марке.

Замечания

Панель поля отображается под основным текстом CTaskDialog класса.

Используйте nMarqueeSpeed , чтобы задать скорость панели маркированного файла; большие значения указывают на медленную скорость. Значение 0 для nMarqueeSpeed делает перемещение панели по умолчанию для Windows.

Этот метод создает исключение с макросом ENSURE , если nMarqueeSpeed меньше 0.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

// Add a marquee progress bar.
taskDialog.SetProgressBarMarquee();

taskDialog.DoModal();

// Remove the marquee bar and replace it with a standard progress bar
taskDialog.SetProgressBarMarquee(0);
taskDialog.SetProgressBarRange(0, 100);
taskDialog.SetProgressBarPosition(75);
taskDialog.SetProgressBarState();

taskDialog.DoModal();

CTaskDialog::SetProgressBarPosition

Настраивает положение индикатора выполнения.

void SetProgressBarPosition(int nProgressPos);

Параметры

nProgressPos
[in] Позиция индикатора выполнения.

Замечания

Этот метод создает исключение с макросом ENSURE , если nProgresssPos не находится в диапазоне индикаторов выполнения. Диапазон индикаторов хода выполнения можно изменить с помощью CTaskDialog::SetProgressBarRange.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

// Add a marquee progress bar.
taskDialog.SetProgressBarMarquee();

taskDialog.DoModal();

// Remove the marquee bar and replace it with a standard progress bar
taskDialog.SetProgressBarMarquee(0);
taskDialog.SetProgressBarRange(0, 100);
taskDialog.SetProgressBarPosition(75);
taskDialog.SetProgressBarState();

taskDialog.DoModal();

CTaskDialog::SetProgressBarRange

Настраивает диапазон индикатора выполнения.

void SetProgressBarRange(
    int nRangeMin,
    int nRangeMax);

Параметры

nRangeMin
[in] Нижняя граница индикатора выполнения.

nRangeMax
[in] Верхняя граница панели выполнения.

Замечания

Позиция панели выполнения относительно nRangeMin и nRangeMax. Например, если nRangeMin равен 50, а nRangeMax равно 100, позиция 75 находится на полпути в строке выполнения. Используйте CTaskDialog::SetProgressBarPosition , чтобы задать положение панели выполнения.

Чтобы отобразить индикатор выполнения, параметр TDF_SHOW_PROGRESS_BAR должен быть включен и TDF_SHOW_MARQUEE_PROGRESS_BAR не должен быть включен. Этот метод автоматически задает TDF_SHOW_PROGRESS_BAR и очищает TDF_SHOW_MARQUEE_PROGRESS_BAR. Используйте CTaskDialog::SetOptions , чтобы вручную изменить параметры этого экземпляра класса CTaskDialog.

Этот метод создает исключение с макросом ENSURE , если nRangeMin не меньше nRangeMax. Этот метод также создает исключение, если CTaskDialog он уже отображается и имеет индикатор хода выполнения.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

// Add a marquee progress bar.
taskDialog.SetProgressBarMarquee();

taskDialog.DoModal();

// Remove the marquee bar and replace it with a standard progress bar
taskDialog.SetProgressBarMarquee(0);
taskDialog.SetProgressBarRange(0, 100);
taskDialog.SetProgressBarPosition(75);
taskDialog.SetProgressBarState();

taskDialog.DoModal();

CTaskDialog::SetProgressBarState

Задает состояние индикатора выполнения и отображает его на панели CTaskDialogвыполнения.

void SetProgressBarState(int nState = PBST_NORMAL);

Параметры

nState
[in] Состояние индикатора выполнения. Сведения о возможных значениях см. в разделе "Примечания".

Замечания

Этот метод создает исключение с макросом ENSURE , если CTaskDialog он уже отображается и имеет индикатор хода выполнения.

В следующей таблице перечислены возможные значения nState. Во всех этих случаях индикатор хода выполнения заполняется обычным цветом, пока он не достигнет указанной позиции остановки. На этом этапе он изменит цвет на основе состояния.

Имя Описание
PBST_NORMAL После заливки CTaskDialog индикатора хода выполнения не изменяется цвет панели. По умолчанию обычный цвет зеленый.
PBST_ERROR После заливки CTaskDialog индикатора выполнения изменит цвет панели на цвет ошибки. По умолчанию это красный цвет.
PBST_PAUSED После заливки CTaskDialog индикатора выполнения изменит цвет панели на приостановленный цвет. По умолчанию это желтый цвет.

Можно задать место остановки панели хода выполнения с помощью CTaskDialog::SetProgressBarPosition.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

// Add a marquee progress bar.
taskDialog.SetProgressBarMarquee();

taskDialog.DoModal();

// Remove the marquee bar and replace it with a standard progress bar
taskDialog.SetProgressBarMarquee(0);
taskDialog.SetProgressBarRange(0, 100);
taskDialog.SetProgressBarPosition(75);
taskDialog.SetProgressBarState();

taskDialog.DoModal();

CTaskDialog::SetRadioButtonOptions

Включает или отключает переключатель.

void SetRadioButtonOptions(
    int nRadioButtonID,
    BOOL bEnabled);

Параметры

nRadioButtonID
[in] Идентификатор элемента управления переключателя.

bEnabled
[in] ЗНАЧЕНИЕ TRUE для включения переключателя; Значение FALSE, чтобы отключить переключатель.

Замечания

Этот метод создает исключение с макросом ENSURE , если nRadioButtonID не является допустимым идентификатором для переключателя.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

taskDialog.AddRadioButton(201, L"First option");
taskDialog.AddRadioButton(202, L"Second option");
taskDialog.AddRadioButton(203, L"Third option");

taskDialog.DoModal();
int selection = taskDialog.GetSelectedRadioButtonID();

switch (selection)
{
case 201:
   // TODO: Place processing here for the first
   // radio button.
   break;

case 202:
   // TODO: Place processing here for the second
   // radio button.
   break;

case 203:
   // TODO: Place processing here for the third
   // radio button.
   break;

default:
   break;
}

// Remove all the radio buttons so that we can use the same task
// dialog with new radio buttons.
taskDialog.RemoveAllRadioButtons();

taskDialog.AddRadioButton(301, L"New first option");
taskDialog.AddRadioButton(302, L"New second option");
taskDialog.AddRadioButton(303,
                          L"New third option should be disabled");

// Change the default radio button to the second option
taskDialog.SetDefaultRadioButton(302);

// Make sure the third option is disabled.
if (taskDialog.IsRadioButtonEnabled(303))
{
   taskDialog.SetRadioButtonOptions(303, FALSE);
}

taskDialog.DoModal();
selection = taskDialog.GetSelectedRadioButtonID();

switch (taskDialog.GetSelectedRadioButtonID())
{
case 301:
   // TODO: Place processing here for new first
   // command button control.
   break;

case 302:
   // TODO: Place processing here for new second
   // command button control.
   break;

case 303:
   // TODO: Place processing here for the new third
   // command button control.
   break;

default:
   break;
}

// Remove all the radio button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllRadioButtons();
taskDialog.LoadRadioButtons(1001, 1005);

CTaskDialog::SetVerificationCheckbox

Задает проверка состояние поля проверки проверка.

void SetVerificationCheckbox(BOOL bChecked);

Параметры

bChecked
[in] Значение TRUE, чтобы поле проверки проверка выбрано при CTaskDialog отображении; Значение FALSE, чтобы поле проверки проверка не выбрано при CTaskDialog отображении.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

// Add the verification checkbox and set the default state.
taskDialog.SetVerificationCheckboxText(L"Remember your selection.");
taskDialog.SetVerificationCheckbox(false);

taskDialog.DoModal();

if (taskDialog.GetVerificationCheckboxState())
{
   // TODO: Write settings of the task dialog to the registry
}

CTaskDialog::SetVerificationCheckboxText

Задает текст, отображаемый справа от поля проверки проверка.

void SetVerificationCheckboxText(CString& strVerificationText);

Параметры

strVerificationText
[in] Текст, отображаемый этим методом рядом с полем проверки проверка.

Замечания

Этот метод создает исключение с макросом ENSURE , если этот экземпляр CTaskDialog класса уже отображается.

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

// Add the verification checkbox and set the default state.
taskDialog.SetVerificationCheckboxText(L"Remember your selection.");
taskDialog.SetVerificationCheckbox(false);

taskDialog.DoModal();

if (taskDialog.GetVerificationCheckboxState())
{
   // TODO: Write settings of the task dialog to the registry
}

CTaskDialog::SetWindowTitle

Задает заголовок CTaskDialog.

void SetWindowTitle(CString& strWindowTitle);

Параметры

strWindowTitle
[in] Новый заголовок для CTaskDialog.

Замечания

Пример

// TODO: Replace the strings below with the appropriate message,
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title,
                       TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);

// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);

// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);

// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
                            L"Click here for more information.",
                            L"Click here to hide the extra information.");

// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);

taskDialog.DoModal();

CTaskDialog::ShowDialog

Создает и отображает объект 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(""));

Параметры

strContent
[in] Строка, используемая для содержимого CTaskDialogобъекта .

strMainInstruction
[in] Основная инструкция CTaskDialog.

strTitle
[in] Заголовок CTaskDialog.

nIDCommandControlsFirst
[in] Строковый идентификатор первой команды.

nIDCommandControlsLast
[in] Строковый идентификатор последней команды.

nCommonButtons
[in] Маска кнопок, добавляемых в CTaskDialog.

nTaskDialogOptions
[in] Набор параметров, используемых для CTaskDialogобъекта .

strFooter
[in] Строка, используемая в качестве нижнего колонтитула.

Возвращаемое значение

Целое число, соответствующее выбранному пользователем.

Замечания

Этот статический метод позволяет создавать экземпляр класса без явного CTaskDialog создания CTaskDialog объекта в коде. Так как нет CTaskDialog объекта, вы не можете вызывать другие методы CTaskDialog , если этот метод используется для отображения CTaskDialog пользователю.

Этот метод создает элементы управления кнопкой команд с помощью данных из файла ресурсов приложения. Таблица строк в файле ресурсов содержит несколько строк с связанными идентификаторами строк. Этот метод добавляет элемент управления кнопкой команд для каждой допустимой записи в строковой таблице между nIDCommandControlsFirst и nCommandControlsLast включительно. Для этих элементов управления кнопкой команды строка в строковой таблице — это подпись элемента управления, а идентификатор строки — идентификатор элемента управления.

Список допустимых параметров см. в разделе CTaskDialog::SetOptions .

Закрывается CTaskDialog , когда пользователь выбирает общую кнопку, элемент управления командной ссылкой или закрывается CTaskDialog. Возвращаемое значение — это идентификатор, указывающий, как пользователь закрыл диалоговое окно.

Пример

// 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);
}

CTaskDialog::TaskDialogCallback

Платформа вызывает этот метод в ответ на различные сообщения Windows.

friend:
HRESULT TaskDialogCallback(
    HWND hWnd,
    UINT uNotification,
    WPARAM wParam,
    LPARAM lParam,
    LONG_PTR dwRefData);

Параметры

hwnd
[in] Дескриптор m_hWnd структуры для CTaskDialog.

uNotification
[in] Код уведомления, указывающий созданное сообщение.

wParam
[in] Дополнительные сведения о сообщении.

lParam
[in] Дополнительные сведения о сообщении.

dwRefData
[in] Указатель на CTaskDialog объект, к которому применяется сообщение обратного вызова.

Возвращаемое значение

Зависит от конкретного кода уведомления. Дополнительные сведения см. в разделе «Примечания».

Замечания

Реализация по умолчанию TaskDialogCallback обрабатывает конкретное сообщение, а затем вызывает соответствующий метод On класса CTaskDialog. Например, в ответ на сообщение TaskDialogCallback TDN_BUTTON_CLICKED вызывает CTaskDialog::OnCommandControlClick.

Значения wParam и lParam зависят от конкретного созданного сообщения. Для любого или обоих из этих значений может быть пустым. В следующей таблице перечислены поддерживаемые уведомления по умолчанию и значения wParam и lParam. При переопределении этого метода в производном классе следует реализовать код обратного вызова для каждого сообщения в следующей таблице.

Сообщение уведомления Значение wParam значение lParam
TDN_CREATED Не используется. Не используется.
TDN_NAVIGATED Не используется. Не используется.
TDN_BUTTON_CLICKED Идентификатор элемента управления кнопкой командной кнопки. Не используется.
TDN_HYPERLINK_CLICKED Не используется. Структура LPCWSTR , содержащая ссылку.
TDN_TIMER Время в миллисекундах после CTaskDialog создания или сброса таймера. Не используется.
TDN_DESTROYED Не используется. Не используется.
TDN_RADIO_BUTTON_CLICKED Идентификатор переключателя. Не используется.
TDN_DIALOG_CONSTRUCTED Не используется. Не используется.
TDN_VERIFICATION_CLICKED Значение 1, если поле проверка проверка, значение 0, если это не так. Не используется.
TDN_HELP Не используется. Не используется.
TDN_EXPANDO_BUTTON_CLICKED Значение 0, если область расширения свернута; ненулевое значение, если отображается текст расширения. Не используется.

См. также

Классы
Класс CObject
Диаграмма иерархии
Пошаговое руководство. Добавление CTaskDialog в приложение