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