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);
}
要求
标头: afxtaskdialog.h