PFTASKDIALOGCALLBACK callback function (commctrl.h)

The TaskDialogCallbackProc function is an application-defined function used with the TaskDialogIndirect function. It receives messages from the task dialog when various events occur.

The PFTASKDIALOGCALLBACK type defines a pointer to this callback function. TaskDialogCallbackProc is a placeholder for the application defined function name.

Syntax

PFTASKDIALOGCALLBACK Pftaskdialogcallback;

HRESULT Pftaskdialogcallback(
  [in] HWND hwnd,
  [in] UINT msg,
  [in] WPARAM wParam,
  [in] LPARAM lParam,
       LONG_PTR lpRefData
)
{...}

Parameters

[in] hwnd

Type: HWND

Handle to the TaskDialog window. Do not continue sending messages to hwnd after the callback procedure returns from having been called with TDN_DESTROYED.

[in] msg

Type: UINT

One of the following notifications.

Notification Usage
TDN_BUTTON_CLICKED Indicates that a button has been selected. The command ID of the button is specified by wParam.
TDN_CREATED Indicates that the Task Dialog has been created.
TDN_DESTROYED Indicates that the Task Dialog has been destroyed.
TDN_DIALOG_CONSTRUCTED Indicates that the Task Dialog has been created but has not been displayed yet.
TDN_EXPANDO_BUTTON_CLICKED Indicates that the expando button has been selected.
TDN_HELP Indicates that the F1 key has been pressed while the Task Dialog has focus.
TDN_HYPERLINK_CLICKED Indicates that a hyperlink has been selected. A pointer to the link text is specified by lParam.
TDN_NAVIGATED Indicates that navigation has occurred.
TDN_RADIO_BUTTON_CLICKED Indicates that a radio button has been selected. The command ID of the radio button is specified by wParam.
TDN_TIMER Indicates that the Task Dialog timer has fired. The total elapsed time is specified by wParam. You can update the progress bar by sending a TDM_SET_PROGRESS_BAR_POS message to the window specified by the hwnd parameter.
TDN_VERIFICATION_CLICKED Indicates that the Task Dialog verification check box has been selected.

[in] wParam

Type: WPARAM

Specifies additional notification information. The contents of this parameter depend on the value of the uNotification parameter.

[in] lParam

Type: LPARAM

Specifies additional notification information. The contents of this parameter depend on the value of the uNotification parameter.

lpRefData

Type: LONG_PTR

Pointer to application specific data. This is the data pointed to by the lpCallbackData member of structure TASKDIALOGCONFIG used to create the task dialog.

Return value

Type: HRESULT

The return value is specific to the notification being processed. When responding to a button click, your implementation should return S_FALSE if the Task Dialog is not to close. Otherwise return S_OK.

Remarks

An application must register this callback function by passing its address in the pfCallback member of the TASKDIALOGCONFIG structure that is passed via pointer through TaskDialogIndirect.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header commctrl.h (include Commctrl.h)