다음을 통해 공유


CTaskDialog::SetCommonButtons

일반적인 단추에 추가 된 CTaskDialog.

void SetCommonButtons(
   int nButtonMask,
   int nDisabledButtonMask = 0,
   int nElevationButtonMask = 0
);

매개 변수

  • [in] nButtonMask
    단추를 추가 하는 마스크는 CTaskDialog.

  • [in] nDisabledButtonMask
    마스크 해제 하는 단추입니다.

  • [in] nElevationButtonMask
    권한 상승이 필요한 단추 마스크입니다.

설명

후 디스플레이 창이 인스턴스에 대해이 메서드를 호출할 수 없습니다는 CTaskDialog 클래스 만들어집니다.이렇게 하면이 메서드는 예외가 throw 됩니다.

단추를 표시 하 여 nButtonMask 재정의 추가 이전에 일반적인 단추는 CTaskDialog.단추만 표시 nButtonMask 사용할 수 있습니다.

경우 nDisabledButtonMask 또는 nElevationButtonMask 에 없는 단추를 포함 nButtonMask를 사용 하 여이 메서드에서 예외가 throw는 (MFC)를 확인 합니다. 매크로.

기본적으로 일반적인 단추를 모두 사용할 수 있으며 권한 상승이 필요 하지 않습니다.

예제

// TODO: Replace the strings below with the appropriate message, 
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title);

// Create a button mask.
int buttons = TDCBF_OK_BUTTON | TDCBF_CANCEL_BUTTON;
buttons |= TDCBF_RETRY_BUTTON | TDCBF_CLOSE_BUTTON;

taskDialog.SetCommonButtons(buttons);

// Disable the close button and make the retry button require 
// elevation.
taskDialog.SetCommonButtonOptions(TDCBF_CLOSE_BUTTON, 
    TDCBF_RETRY_BUTTON);

taskDialog.DoModal();

요구 사항

헤더: afxtaskdialog.h

참고 항목

참조

CTaskDialog 클래스

계층 구조 차트

CTaskDialog::SetCommonButtonOptions