How to Get User Input from a Task Dialog

To complete a task, users submit the task details to the application by configuring the controls within the task dialog, and then clicking a command button (usually OK).

What you need to know

Technologies

Prerequisites

  • C/C++
  • Windows User Interface Programming

Instructions

Getting User Input from a Task Dialog

You can identify the button that was clicked by examining the pnButton parameter of the calling function. You can also identify the selected radio button from the pnRadioButton parameter of TaskDialogIndirect, and the state of the verification check box from the pfVerificationFlagChecked parameter.

Clicks on buttons and hyperlinks are received by the TaskDialogCallbackProc function in the form of TDN_BUTTON_CLICKED and TDN_HYPERLINK_CLICKED notifications. If your callback function returns S_OK after handling a button notification, the task dialog closes and the command identifier of the button is returned in pnButton. If you return S_FALSE, or do not have a callback function, the task dialog remains open.

Using Task Dialogs