共用方式為


CTaskDialog::IsSupported

Determines whether the computer that is running the application supports the CTaskDialog.

static BOOL IsSupported();

Return Value

TRUE if the computer supports the CTaskDialog; FALSE otherwise.

Remarks

Use this function to determine at runtime if the computer that is running your application supports the CTaskDialog Class. If the computer does not support the CTaskDialog, you should provide another method of communicating information to the user. Your application will crash if it tries to use a CTaskDialog on a computer that does not support the CTaskDialog class.

Example

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

Requirements

Header: afxtaskdialog.h

See Also

Reference

CTaskDialog Class

Hierarchy Chart