Classe CTaskDialog
Uma caixa de diálogo pop-up que funciona como uma caixa de mensagem, mas pode exibir informações adicionais para o usuário. A CTaskDialog
funcionalidade também inclui a coleta de informações do usuário.
Sintaxe
class CTaskDialog : public CObject
Membros
Construtores
Nome | Descrição |
---|---|
CTaskDialog::CTaskDialog | Constrói um objeto CTaskDialog . |
Métodos
Nome | Descrição |
---|---|
CTaskDialog::AddCommandControl | Adiciona um controle de botão de comando ao CTaskDialog . |
CTaskDialog::AddRadioButton | Adiciona um botão de opção CTaskDialog ao . |
CTaskDialog::ClickCommandControl | Clica em um controle de botão de comando ou botão comum programaticamente. |
CTaskDialog::ClickRadioButton | Clica em um botão de opção programaticamente. |
CTaskDialog::D oModal | Exibe o CTaskDialog . |
CTaskDialog::GetCommonButtonCount | Recupera o número de botões comuns disponíveis. |
CTaskDialog::GetCommonButtonFlag | Converte um botão Windows padrão no tipo de botão comum associado à CTaskDialog classe. |
CTaskDialog::GetCommonButtonId | Converte um dos tipos de botão comuns associados à CTaskDialog classe em um botão de Windows padrão. |
CTaskDialog::GetOptions | Retorna os sinalizadores de opção para isso CTaskDialog . |
CTaskDialog::GetSelectedCommandControlID | Retorna o controle de botão de comando selecionado. |
CTaskDialog::GetSelectedRadioButtonID | Retorna o botão de opção selecionado. |
CTaskDialog::GetVerificationCheckboxState | Recupera o estado da caixa de seleção de verificação. |
CTaskDialog::IsCommandControlEnabled | Determina se um controle de botão de comando ou um botão comum está habilitado. |
CTaskDialog::IsRadioButtonEnabled | Determina se um botão de opção está habilitado. |
CTaskDialog::IsSupported | Determina se o computador que está executando o aplicativo dá suporte ao CTaskDialog . |
CTaskDialog::LoadCommandControls | Adiciona controles de botão de comando usando dados da tabela de cadeia de caracteres. |
CTaskDialog::LoadRadioButtons | Adiciona botões de opção usando dados da tabela de cadeia de caracteres. |
CTaskDialog::NavigateTo | Transfere o foco para outro CTaskDialog . |
CTaskDialog::OnCommandControlClick | A estrutura chama esse método quando o usuário clica em um controle de botão de comando. |
CTaskDialog::OnCreate | A estrutura chama esse método depois de criar o CTaskDialog . |
CTaskDialog::OnDestroy | A estrutura chama esse método imediatamente antes de destruir o CTaskDialog . |
CTaskDialog::OnExpandButtonClick | A estrutura chama esse método quando o usuário clica no botão de expansão. |
CTaskDialog::OnHelp | A estrutura chama esse método quando o usuário solicita ajuda. |
CTaskDialog::OnHyperlinkClick | A estrutura chama esse método quando o usuário clica em um hiperlink. |
CTaskDialog::OnInit | A estrutura chama esse método quando o CTaskDialog método é inicializado. |
CTaskDialog::OnNavigatePage | A estrutura chama esse método quando o usuário move o foco em relação aos controles no CTaskDialog . |
CTaskDialog::OnRadioButtonClick | A estrutura chama esse método quando o usuário seleciona um controle de botão de opção. |
CTaskDialog::OnTimer | A estrutura chama esse método quando o temporizador expira. |
CTaskDialog::OnVerificationCheckboxClick | A estrutura chama esse método quando o usuário clica na caixa de seleção de verificação. |
CTaskDialog::RemoveAllCommandControls | Remove todos os controles de comando do CTaskDialog . |
CTaskDialog::RemoveAllRadioButtons | Remove todos os botões de opção do CTaskDialog . |
CTaskDialog::SetCommandControlOptions | Atualiza um controle de botão de comando no CTaskDialog . |
CTaskDialog::SetCommonButtonOptions | Atualiza um subconjunto de botões comuns a serem habilitados e exigem elevação de UAC. |
CTaskDialog::SetCommonButtons | Adiciona botões comuns ao CTaskDialog . |
CTaskDialog::SetContent | Atualiza o conteúdo do CTaskDialog . |
CTaskDialog::SetDefaultCommandControl | Especifica o controle de botão de comando padrão. |
CTaskDialog::SetDefaultRadioButton | Especifica o botão de opção padrão. |
CTaskDialog::SetDialogWidth | Ajusta a largura do CTaskDialog . |
CTaskDialog::SetExpansionArea | Atualiza a área de expansão da CTaskDialog . |
CTaskDialog::SetFooterIcon | Atualiza o ícone de rodapé do CTaskDialog . |
CTaskDialog::SetFooterText | Atualiza o texto no rodapé do CTaskDialog . |
CTaskDialog::SetMainIcon | Atualiza o ícone principal do CTaskDialog . |
CTaskDialog::SetMainInstruction | Atualiza a instrução principal do CTaskDialog . |
CTaskDialog::SetOptions | Configura as opções para o CTaskDialog . |
CTaskDialog::SetProgressBarMarquee | Configura uma barra de marquise para a CTaskDialog caixa de diálogo e a adiciona à caixa de diálogo. |
CTaskDialog::SetProgressBarPosition | Ajusta a posição da barra de progresso. |
CTaskDialog::SetProgressBarRange | Ajusta o intervalo da barra de progresso. |
CTaskDialog::SetProgressBarState | Define o estado da barra de progresso e exibe-o CTaskDialog no . |
CTaskDialog::SetRadioButtonOptions | Habilita ou desabilita um botão de opção. |
CTaskDialog::SetVerificationCheckbox | Define o estado marcado da caixa de seleção de verificação. |
CTaskDialog::SetVerificationCheckboxText | Define o texto no lado direito da caixa de seleção de verificação. |
CTaskDialog::SetWindowTitle | Define o título do CTaskDialog . |
CTaskDialog::ShowDialog | Cria e exibe um CTaskDialog . |
CTaskDialog::TaskDialogCallback | A estrutura chama isso em resposta a várias mensagens Windows. |
Membros de dados
Nome | Descrição |
---|---|
m_aButtons |
A matriz de controles de botão de comando para o CTaskDialog . |
m_aRadioButtons |
A matriz de controles de botão de opção para o CTaskDialog . |
m_bVerified |
TRUE indica que a caixa de seleção de verificação está marcada; FALSE indica que não é. |
m_footerIcon |
O ícone no rodapé do CTaskDialog . |
m_hWnd |
Um identificador para a janela do CTaskDialog . |
m_mainIcon |
O ícone principal do CTaskDialog . |
m_nButtonDisabled |
Uma máscara que indica quais dos botões comuns estão desabilitados. |
m_nButtonElevation |
Uma máscara que indica quais dos botões comuns exigem elevação de UAC. |
m_nButtonId |
A ID do controle de botão de comando selecionado. |
m_nCommonButton |
Uma máscara que indica quais botões comuns são exibidos no CTaskDialog . |
m_nDefaultCommandControl |
A ID do controle do botão de comando que é selecionado quando o CTaskDialog recurso é exibido. |
m_nDefaultRadioButton |
A ID do controle do botão de opção selecionada quando a CTaskDialog tela é exibida. |
m_nFlags |
Uma máscara que indica as opções para o CTaskDialog . |
m_nProgressPos |
A posição atual da barra de progresso. Esse valor deve estar entre m_nProgressRangeMin e m_nProgressRangeMax . |
m_nProgressRangeMax |
O valor máximo para a barra de progresso. |
m_nProgressRangeMin |
O valor mínimo para a barra de progresso. |
m_nProgressState |
O estado da barra de progresso. Para obter mais informações, consulte CTaskDialog::SetProgressBarState. |
m_nRadioId |
A ID do controle de botão de opção selecionado. |
m_nWidth |
A largura dos CTaskDialog pixels in. |
m_strCollapse |
A cadeia de caracteres exibida CTaskDialog à direita da caixa de expansão quando as informações expandidas estão ocultas. |
m_strContent |
A cadeia de caracteres de conteúdo do CTaskDialog . |
m_strExpand |
A cadeia de caracteres exibida CTaskDialog à direita da caixa de expansão quando as informações expandidas são exibidas. |
m_strFooter |
O rodapé do CTaskDialog . |
m_strInformation |
As informações expandidas para o CTaskDialog . |
m_strMainInstruction |
A instrução principal do CTaskDialog . |
m_strTitle |
O título do CTaskDialog . |
m_strVerification |
A cadeia de caracteres exibida CTaskDialog à direita da caixa de seleção de verificação. |
Comentários
A CTaskDialog
classe substitui a caixa de mensagem de Windows padrão e tem funcionalidade adicional, como novos controles, para coletar informações do usuário. Essa classe está na biblioteca MFC no Visual Studio 2010 e posterior. Ele CTaskDialog
está disponível a partir do Windows Vista. Versões anteriores do Windows não podem exibir o CTaskDialog
objeto. Use CTaskDialog::IsSupported
para determinar em runtime se o usuário atual pode exibir a caixa de diálogo da tarefa. A caixa de mensagem de Windows padrão ainda tem suporte.
Ela CTaskDialog
está disponível somente quando você cria seu aplicativo usando a biblioteca Unicode.
O CTaskDialog
tem dois construtores diferentes. Um construtor permite que você especifique dois botões de comando e um máximo de seis controles de botão regulares. Você pode adicionar mais botões de comando depois de criar o CTaskDialog
. O segundo construtor não dá suporte a nenhum botão de comando, mas você pode adicionar um número ilimitado de controles de botão regulares. Para obter mais informações sobre os construtores, consulte CTaskDialog::CTaskDialog.
A imagem a seguir mostra um exemplo CTaskDialog
para ilustrar o local de alguns dos controles.
Exemplo de CTaskDialog
Requisitos
Sistema operacional mínimo necessário: Windows Vista
Cabeçalho: afxtaskdialog.h
CTaskDialog::AddCommandControl
Adiciona um novo controle de botão de comando ao CTaskDialog
.
void AddCommandControl(
int nCommandControlID,
const CString& strCaption,
BOOL bEnabled = TRUE,
BOOL bRequiresElevation = FALSE);
Parâmetros
nCommandControlID
[in] O número de identificação do controle de comando.
strCaption
[in] A cadeia de caracteres que o CTaskDialog
usuário exibe. Use essa cadeia de caracteres para explicar a finalidade do comando.
bEnabled
[in] Um parâmetro booliano que indica se o novo botão está habilitado ou desabilitado.
bRequiresElevation
[in] Um parâmetro booliano que indica se um comando requer elevação.
Comentários
Ele CTaskDialog Class
pode exibir um número ilimitado de controles de botão de comando. No entanto, se um CTaskDialog
controle de botão de comando for exibido, ele poderá exibir no máximo seis botões. Se um CTaskDialog
não tiver controles de botão de comando, ele poderá exibir um número ilimitado de botões.
Quando o usuário seleciona um controle de botão de comando, ele CTaskDialog
fecha. Se o aplicativo exibir a caixa de diálogo usando CTaskDialog::D oModal, DoModal
retornará o nCommandControlID do controle de botão de comando selecionado.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
taskDialog.AddCommandControl(201, L"First command button control");
taskDialog.AddCommandControl(202, L"Second command button control");
taskDialog.AddCommandControl(203, L"Third command button control");
// Show the CTaskDialog and remember how the user closed it.
int selection = taskDialog.DoModal();
switch (selection)
{
case 201:
// TODO: Place processing here for the first
// command button control.
break;
case 202:
// TODO: Place processing here for the second
// command button control.
break;
case 203:
// TODO: Place processing here for the third
// command button control.
break;
default:
break;
}
// Remove all the command controls so that we can use the same task
// dialog with new command button controls.
taskDialog.RemoveAllCommandControls();
taskDialog.AddCommandControl(301,
L"New first command button control");
taskDialog.AddCommandControl(302,
L"New second command button control should require elevation",
TRUE, TRUE);
taskDialog.AddCommandControl(303,
L"New third command button control should be disabled");
// Change the default command button control
taskDialog.SetDefaultCommandControl(302);
// Make sure the third option is disabled.
if (taskDialog.IsCommandControlEnabled(303))
{
taskDialog.SetCommandControlOptions(303, FALSE);
}
taskDialog.DoModal();
switch (taskDialog.GetSelectedCommandControlID())
{
case 301:
// TODO: Place processing here for new first
// command button control.
break;
case 302:
// TODO: Place processing here for new second
// command button control.
break;
case 303:
// TODO: Place processing here for the new third
// command button control.
break;
default:
break;
}
// Remove all the command button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllCommandControls();
taskDialog.LoadCommandControls(1001, 1005);
CTaskDialog::AddRadioButton
Adiciona um botão de opção ao CTaskDialog
.
void CTaskDialog::AddRadioButton(
int nRadioButtonID,
const CString& strCaption,
BOOL bEnabled = TRUE);
Parâmetros
nRadioButtonID
[in] O número de identificação do botão de opção.
strCaption
[in] A cadeia de caracteres exibida CTaskDialog
ao lado do botão de opção.
bEnabled
[in] Um parâmetro booliano que indica se o botão de opção está habilitado.
Comentários
Os botões de opção para a Classe CTaskDialog permitem que você colete informações do usuário. Use a função CTaskDialog::GetSelectedRadioButtonID para determinar qual botão de opção está selecionado.
Não CTaskDialog
exige que os parâmetros nRadioButtonID sejam exclusivos para cada botão de opção. No entanto, você poderá ter um comportamento inesperado se não usar um identificador distinto para cada botão de opção.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
taskDialog.AddRadioButton(201, L"First option");
taskDialog.AddRadioButton(202, L"Second option");
taskDialog.AddRadioButton(203, L"Third option");
taskDialog.DoModal();
int selection = taskDialog.GetSelectedRadioButtonID();
switch (selection)
{
case 201:
// TODO: Place processing here for the first
// radio button.
break;
case 202:
// TODO: Place processing here for the second
// radio button.
break;
case 203:
// TODO: Place processing here for the third
// radio button.
break;
default:
break;
}
// Remove all the radio buttons so that we can use the same task
// dialog with new radio buttons.
taskDialog.RemoveAllRadioButtons();
taskDialog.AddRadioButton(301, L"New first option");
taskDialog.AddRadioButton(302, L"New second option");
taskDialog.AddRadioButton(303,
L"New third option should be disabled");
// Change the default radio button to the second option
taskDialog.SetDefaultRadioButton(302);
// Make sure the third option is disabled.
if (taskDialog.IsRadioButtonEnabled(303))
{
taskDialog.SetRadioButtonOptions(303, FALSE);
}
taskDialog.DoModal();
selection = taskDialog.GetSelectedRadioButtonID();
switch (taskDialog.GetSelectedRadioButtonID())
{
case 301:
// TODO: Place processing here for new first
// command button control.
break;
case 302:
// TODO: Place processing here for new second
// command button control.
break;
case 303:
// TODO: Place processing here for the new third
// command button control.
break;
default:
break;
}
// Remove all the radio button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllRadioButtons();
taskDialog.LoadRadioButtons(1001, 1005);
CTaskDialog::ClickCommandControl
Clica em um controle de botão de comando ou botão comum programaticamente.
protected:
void ClickCommandControl(int nCommandControlID) const;
Parâmetros
nCommandControlID
[in] A ID de comando do controle a ser clicada.
Comentários
Esse método gera a mensagem do Windows TDM_CLICK_BUTTON.
CTaskDialog::ClickRadioButton
Clica em um botão de opção programaticamente.
protected:
void ClickRadioButton(int nRadioButtonID) const;
Parâmetros
nRadioButtonID
[in] A ID do botão de opção a ser clicada.
Comentários
Esse método gera a mensagem do Windows TDM_CLICK_RADIO_BUTTON.
CTaskDialog::CTaskDialog
Cria uma instância da classe CTaskDialog.
CTaskDialog(
const CString& strContent,
const CString& strMainInstruction,
const CString& strTitle,
int nCommonButtons = TDCBF_OK_BUTTON | TDCBF_CANCEL_BUTTON,
int nTaskDialogOptions = TDF_ENABLE_HYPERLINKS | TDF_USE_COMMAND_LINKS,
const CString& strFooter = _T(""));
CTaskDialog(
const CString& strContent,
const CString& strMainInstruction,
const CString& strTitle,
int nIDCommandControlsFirst,
int nIDCommandControlsLast,
int nCommonButtons,
int nTaskDialogOptions = TDF_ENABLE_HYPERLINKS | TDF_USE_COMMAND_LINKS,
const CString& strFooter = _T(""));
Parâmetros
strContent
[in] A cadeia de caracteres a ser usada para o conteúdo do CTaskDialog
.
strMainInstruction
[in] A instrução principal do CTaskDialog
.
strTitle
[in] O título do CTaskDialog
.
nCommonButtons
[in] Uma máscara dos botões comuns a serem adicionados ao CTaskDialog
.
nTaskDialogOptions
[in] O conjunto de opções a ser usado para o CTaskDialog
.
strFooter
[in] A cadeia de caracteres a ser usada como rodapé.
nIDCommandControlsFirst
[in] A ID da cadeia de caracteres do primeiro comando.
nIDCommandControlsLast
[in] A ID da cadeia de caracteres do último comando.
Comentários
Há duas maneiras de adicionar um CTaskDialog
ao seu aplicativo. A primeira maneira é usar um dos construtores para criar um CTaskDialog
e exibi-lo usando CTaskDialog::D oModal. A segunda maneira é usar a função estática CTaskDialog::ShowDialog, que permite exibir um CTaskDialog
sem criar explicitamente um CTaskDialog
objeto.
O segundo construtor cria controles de botão de comando usando dados do arquivo de recurso do aplicativo. A tabela de cadeia de caracteres no arquivo de recurso tem várias cadeias de caracteres com IDs de cadeia de caracteres associadas. Esse método adiciona um controle de botão de comando para cada entrada válida na tabela de cadeia de caracteres entre nIDCommandControlsFirst e nCommandControlsLast, inclusive. Para esses controles de botão de comando, a cadeia de caracteres na tabela de cadeia de caracteres é a legenda do controle e a ID da cadeia de caracteres é a ID do controle.
Consulte CTaskDialog::SetOptions para obter uma lista de opções válidas.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);
// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);
// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
L"Click here for more information.",
L"Click here to hide the extra information.");
// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);
taskDialog.DoModal();
CTaskDialog::D oModal
Mostra o CTaskDialog
e o torna modal.
INT_PTR DoModal (HWND hParent = ::GetActiveWindow());
Parâmetros
hParent
[in] A janela pai do CTaskDialog
.
Valor Retornado
Um inteiro que corresponde à seleção feita pelo usuário.
Comentários
Exibe essa instância do CTaskDialog. Em seguida, o aplicativo aguarda o usuário fechar a caixa de diálogo.
Fecha CTaskDialog
quando o usuário seleciona um botão comum, um controle de link de comando ou fecha o CTaskDialog
. O valor retornado é o identificador que indica como o usuário fechou a caixa de diálogo.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);
// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);
// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
L"Click here for more information.",
L"Click here to hide the extra information.");
// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);
taskDialog.DoModal();
CTaskDialog::GetCommonButtonCount
Recupera o número de botões comuns.
int GetCommonButtonCount() const;
Valor Retornado
O número de botões comuns disponíveis.
Comentários
Os botões comuns são os botões padrão que você fornece ao CTaskDialog::CTaskDialog. A Classe CTaskDialog exibe os botões na parte inferior da caixa de diálogo.
A lista enumerada de botões é fornecida em CommCtrl.h.
CTaskDialog::GetCommonButtonFlag
Converte um botão de Windows padrão no tipo de botão comum associado à Classe CTaskDialog.
int GetCommonButtonFlag(int nButtonId) const;
Parâmetros
nButtonId
[in] O valor padrão do botão Windows.
Valor Retornado
O valor do botão comum correspondente CTaskDialog
. Se não houver um botão comum correspondente, este método retornará 0.
CTaskDialog::GetCommonButtonId
Converte um dos tipos de botão comuns associados à Classe CTaskDialog em um botão de Windows padrão.
int GetCommonButtonId(int nFlag);
Parâmetros
nFlag
[in] O tipo de botão comum associado à CTaskDialog
classe.
Valor Retornado
O valor do botão de Windows padrão correspondente. Se não houver um botão de Windows correspondente, o método retornará 0.
CTaskDialog::GetOptions
Retorna os sinalizadores de opção para isso CTaskDialog
.
int GetOptions() const;
Valor Retornado
As bandeiras para o CTaskDialog
.
Comentários
Para obter mais informações sobre as opções disponíveis para a classe CTaskDialog, consulte CTaskDialog::SetOptions.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);
// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);
// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
L"Click here for more information.",
L"Click here to hide the extra information.");
// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);
taskDialog.DoModal();
CTaskDialog::GetSelectedCommandControlID
Retorna o controle de botão de comando selecionado.
int GetSelectedCommandControlID() const;
Valor Retornado
A ID do controle de botão de comando selecionado no momento.
Comentários
Você não precisa usar esse método para recuperar a ID do botão de comando selecionado pelo usuário. Essa ID é retornada por CTaskDialog::D oModal ou CTaskDialog::ShowDialog.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
taskDialog.AddCommandControl(201, L"First command button control");
taskDialog.AddCommandControl(202, L"Second command button control");
taskDialog.AddCommandControl(203, L"Third command button control");
// Show the CTaskDialog and remember how the user closed it.
int selection = taskDialog.DoModal();
switch (selection)
{
case 201:
// TODO: Place processing here for the first
// command button control.
break;
case 202:
// TODO: Place processing here for the second
// command button control.
break;
case 203:
// TODO: Place processing here for the third
// command button control.
break;
default:
break;
}
// Remove all the command controls so that we can use the same task
// dialog with new command button controls.
taskDialog.RemoveAllCommandControls();
taskDialog.AddCommandControl(301,
L"New first command button control");
taskDialog.AddCommandControl(302,
L"New second command button control should require elevation",
TRUE, TRUE);
taskDialog.AddCommandControl(303,
L"New third command button control should be disabled");
// Change the default command button control
taskDialog.SetDefaultCommandControl(302);
// Make sure the third option is disabled.
if (taskDialog.IsCommandControlEnabled(303))
{
taskDialog.SetCommandControlOptions(303, FALSE);
}
taskDialog.DoModal();
switch (taskDialog.GetSelectedCommandControlID())
{
case 301:
// TODO: Place processing here for new first
// command button control.
break;
case 302:
// TODO: Place processing here for new second
// command button control.
break;
case 303:
// TODO: Place processing here for the new third
// command button control.
break;
default:
break;
}
// Remove all the command button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllCommandControls();
taskDialog.LoadCommandControls(1001, 1005);
CTaskDialog::GetSelectedRadioButtonID
Retorna o botão de opção selecionado.
int GetSelectedRadioButtonID() const;
Valor Retornado
A ID do botão de opção selecionado.
Comentários
Você pode usar esse método depois que o usuário fechar a caixa de diálogo para recuperar o botão de opção selecionado.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
taskDialog.AddRadioButton(201, L"First option");
taskDialog.AddRadioButton(202, L"Second option");
taskDialog.AddRadioButton(203, L"Third option");
taskDialog.DoModal();
int selection = taskDialog.GetSelectedRadioButtonID();
switch (selection)
{
case 201:
// TODO: Place processing here for the first
// radio button.
break;
case 202:
// TODO: Place processing here for the second
// radio button.
break;
case 203:
// TODO: Place processing here for the third
// radio button.
break;
default:
break;
}
// Remove all the radio buttons so that we can use the same task
// dialog with new radio buttons.
taskDialog.RemoveAllRadioButtons();
taskDialog.AddRadioButton(301, L"New first option");
taskDialog.AddRadioButton(302, L"New second option");
taskDialog.AddRadioButton(303,
L"New third option should be disabled");
// Change the default radio button to the second option
taskDialog.SetDefaultRadioButton(302);
// Make sure the third option is disabled.
if (taskDialog.IsRadioButtonEnabled(303))
{
taskDialog.SetRadioButtonOptions(303, FALSE);
}
taskDialog.DoModal();
selection = taskDialog.GetSelectedRadioButtonID();
switch (taskDialog.GetSelectedRadioButtonID())
{
case 301:
// TODO: Place processing here for new first
// command button control.
break;
case 302:
// TODO: Place processing here for new second
// command button control.
break;
case 303:
// TODO: Place processing here for the new third
// command button control.
break;
default:
break;
}
// Remove all the radio button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllRadioButtons();
taskDialog.LoadRadioButtons(1001, 1005);
CTaskDialog::GetVerificationCheckboxState
Recupera o estado da caixa de seleção de verificação.
BOOL GetVerificationCheckboxState() const;
Valor Retornado
TRUE se a caixa de seleção estiver marcada, FALSE se não estiver.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
// Add the verification checkbox and set the default state.
taskDialog.SetVerificationCheckboxText(L"Remember your selection.");
taskDialog.SetVerificationCheckbox(false);
taskDialog.DoModal();
if (taskDialog.GetVerificationCheckboxState())
{
// TODO: Write settings of the task dialog to the registry
}
CTaskDialog::IsCommandControlEnabled
Determina se um botão ou controle de botão de comando está habilitado.
BOOL IsCommandControlEnabled(int nCommandControlID) const;
Parâmetros
nCommandControlID
[in] A ID do botão ou controle de botão de comando a ser testado.
Valor Retornado
TRUE se o controle estiver habilitado, FALSE se não estiver.
Comentários
Você pode usar esse método para determinar a disponibilidade dos controles de botão de comando e os botões comuns da CTaskDialog
Classe*.
Se nCommandControlID não for um identificador válido para um botão comum CTaskDialog
ou um controle de botão de comando, esse método gerará uma exceção.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
taskDialog.AddCommandControl(201, L"First command button control");
taskDialog.AddCommandControl(202, L"Second command button control");
taskDialog.AddCommandControl(203, L"Third command button control");
// Show the CTaskDialog and remember how the user closed it.
int selection = taskDialog.DoModal();
switch (selection)
{
case 201:
// TODO: Place processing here for the first
// command button control.
break;
case 202:
// TODO: Place processing here for the second
// command button control.
break;
case 203:
// TODO: Place processing here for the third
// command button control.
break;
default:
break;
}
// Remove all the command controls so that we can use the same task
// dialog with new command button controls.
taskDialog.RemoveAllCommandControls();
taskDialog.AddCommandControl(301,
L"New first command button control");
taskDialog.AddCommandControl(302,
L"New second command button control should require elevation",
TRUE, TRUE);
taskDialog.AddCommandControl(303,
L"New third command button control should be disabled");
// Change the default command button control
taskDialog.SetDefaultCommandControl(302);
// Make sure the third option is disabled.
if (taskDialog.IsCommandControlEnabled(303))
{
taskDialog.SetCommandControlOptions(303, FALSE);
}
taskDialog.DoModal();
switch (taskDialog.GetSelectedCommandControlID())
{
case 301:
// TODO: Place processing here for new first
// command button control.
break;
case 302:
// TODO: Place processing here for new second
// command button control.
break;
case 303:
// TODO: Place processing here for the new third
// command button control.
break;
default:
break;
}
// Remove all the command button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllCommandControls();
taskDialog.LoadCommandControls(1001, 1005);
CTaskDialog::IsRadioButtonEnabled
Determina se um botão de opção está habilitado.
BOOL IsRadioButtonEnabled(int nRadioButtonID) const;
Parâmetros
nRadioButtonID
[in] A ID do botão de opção a ser testada.
Valor Retornado
TRUE se o botão de opção estiver habilitado, FALSE se não estiver.
Comentários
Se nRadioButtonID não for um identificador válido para um botão de opção, esse método gerará uma exceção.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
taskDialog.AddRadioButton(201, L"First option");
taskDialog.AddRadioButton(202, L"Second option");
taskDialog.AddRadioButton(203, L"Third option");
taskDialog.DoModal();
int selection = taskDialog.GetSelectedRadioButtonID();
switch (selection)
{
case 201:
// TODO: Place processing here for the first
// radio button.
break;
case 202:
// TODO: Place processing here for the second
// radio button.
break;
case 203:
// TODO: Place processing here for the third
// radio button.
break;
default:
break;
}
// Remove all the radio buttons so that we can use the same task
// dialog with new radio buttons.
taskDialog.RemoveAllRadioButtons();
taskDialog.AddRadioButton(301, L"New first option");
taskDialog.AddRadioButton(302, L"New second option");
taskDialog.AddRadioButton(303,
L"New third option should be disabled");
// Change the default radio button to the second option
taskDialog.SetDefaultRadioButton(302);
// Make sure the third option is disabled.
if (taskDialog.IsRadioButtonEnabled(303))
{
taskDialog.SetRadioButtonOptions(303, FALSE);
}
taskDialog.DoModal();
selection = taskDialog.GetSelectedRadioButtonID();
switch (taskDialog.GetSelectedRadioButtonID())
{
case 301:
// TODO: Place processing here for new first
// command button control.
break;
case 302:
// TODO: Place processing here for new second
// command button control.
break;
case 303:
// TODO: Place processing here for the new third
// command button control.
break;
default:
break;
}
// Remove all the radio button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllRadioButtons();
taskDialog.LoadRadioButtons(1001, 1005);
CTaskDialog::IsSupported
Determina se o computador que está executando o aplicativo dá suporte ao CTaskDialog
.
static BOOL IsSupported();
Valor Retornado
TRUE se o computador der suporte ao CTaskDialog
; FALSE caso contrário.
Comentários
Use essa função para determinar em runtime se o computador que está executando seu aplicativo dá suporte à CTaskDialog
classe. Se o computador não der suporte ao CTaskDialog
, você deverá fornecer outro método de comunicação de informações ao usuário. Seu aplicativo falhará se tentar usar um CTaskDialog
em um computador que não dê suporte à CTaskDialog
classe.
Exemplo
// 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);
}
CTaskDialog::LoadCommandControls
Adiciona controles de botão de comando usando dados da tabela de cadeia de caracteres.
void LoadCommandControls(
int nIDCommandControlsFirst,
int nIDCommandControlsLast);
Parâmetros
nIDCommandControlsFirst
[in] A ID da cadeia de caracteres do primeiro comando.
nIDCommandControlsLast
[in] A ID da cadeia de caracteres do último comando.
Comentários
Esse método cria controles de botão de comando usando dados do arquivo de recurso do aplicativo. A tabela de cadeia de caracteres no arquivo de recurso tem várias cadeias de caracteres com IDs de cadeia de caracteres associadas. Novos controles de botão de comando adicionados usando esse método usam a cadeia de caracteres para a legenda do controle e a ID da cadeia de caracteres para a ID do controle. O intervalo de cadeias de caracteres selecionadas é fornecido por nIDCommandControlsFirst e nCommandControlsLast, inclusive. Se houver uma entrada vazia no intervalo, o método não adicionará um controle de botão de comando para essa entrada.
Por padrão, novos controles de botão de comando estão habilitados e não exigem elevação.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
taskDialog.AddCommandControl(201, L"First command button control");
taskDialog.AddCommandControl(202, L"Second command button control");
taskDialog.AddCommandControl(203, L"Third command button control");
// Show the CTaskDialog and remember how the user closed it.
int selection = taskDialog.DoModal();
switch (selection)
{
case 201:
// TODO: Place processing here for the first
// command button control.
break;
case 202:
// TODO: Place processing here for the second
// command button control.
break;
case 203:
// TODO: Place processing here for the third
// command button control.
break;
default:
break;
}
// Remove all the command controls so that we can use the same task
// dialog with new command button controls.
taskDialog.RemoveAllCommandControls();
taskDialog.AddCommandControl(301,
L"New first command button control");
taskDialog.AddCommandControl(302,
L"New second command button control should require elevation",
TRUE, TRUE);
taskDialog.AddCommandControl(303,
L"New third command button control should be disabled");
// Change the default command button control
taskDialog.SetDefaultCommandControl(302);
// Make sure the third option is disabled.
if (taskDialog.IsCommandControlEnabled(303))
{
taskDialog.SetCommandControlOptions(303, FALSE);
}
taskDialog.DoModal();
switch (taskDialog.GetSelectedCommandControlID())
{
case 301:
// TODO: Place processing here for new first
// command button control.
break;
case 302:
// TODO: Place processing here for new second
// command button control.
break;
case 303:
// TODO: Place processing here for the new third
// command button control.
break;
default:
break;
}
// Remove all the command button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllCommandControls();
taskDialog.LoadCommandControls(1001, 1005);
CTaskDialog::LoadRadioButtons
Adiciona controles de botão de opção usando dados da tabela de cadeia de caracteres.
void LoadRadioButtons(
int nIDRadioButtonsFirst,
int nIDRadioButtonsLast);
Parâmetros
nIDRadioButtonsFirst
[in] A ID da cadeia de caracteres do primeiro botão de opção.
nIDRadioButtonsLast
[in] A ID da cadeia de caracteres do último botão de opção.
Comentários
Esse método cria botões de opção usando dados do arquivo de recurso do aplicativo. A tabela de cadeia de caracteres no arquivo de recurso tem várias cadeias de caracteres com IDs de cadeia de caracteres associadas. Novos botões de opção adicionados usando esse método usam a cadeia de caracteres para a legenda do botão de opção e a ID da cadeia de caracteres para a ID do botão de opção. O intervalo de cadeias de caracteres selecionadas é fornecido por nIDRadioButtonsFirst e nRadioButtonsLast, inclusive. Se houver uma entrada vazia no intervalo, o método não adicionará um botão de opção para essa entrada.
Por padrão, novos botões de opção estão habilitados.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
taskDialog.AddRadioButton(201, L"First option");
taskDialog.AddRadioButton(202, L"Second option");
taskDialog.AddRadioButton(203, L"Third option");
taskDialog.DoModal();
int selection = taskDialog.GetSelectedRadioButtonID();
switch (selection)
{
case 201:
// TODO: Place processing here for the first
// radio button.
break;
case 202:
// TODO: Place processing here for the second
// radio button.
break;
case 203:
// TODO: Place processing here for the third
// radio button.
break;
default:
break;
}
// Remove all the radio buttons so that we can use the same task
// dialog with new radio buttons.
taskDialog.RemoveAllRadioButtons();
taskDialog.AddRadioButton(301, L"New first option");
taskDialog.AddRadioButton(302, L"New second option");
taskDialog.AddRadioButton(303,
L"New third option should be disabled");
// Change the default radio button to the second option
taskDialog.SetDefaultRadioButton(302);
// Make sure the third option is disabled.
if (taskDialog.IsRadioButtonEnabled(303))
{
taskDialog.SetRadioButtonOptions(303, FALSE);
}
taskDialog.DoModal();
selection = taskDialog.GetSelectedRadioButtonID();
switch (taskDialog.GetSelectedRadioButtonID())
{
case 301:
// TODO: Place processing here for new first
// command button control.
break;
case 302:
// TODO: Place processing here for new second
// command button control.
break;
case 303:
// TODO: Place processing here for the new third
// command button control.
break;
default:
break;
}
// Remove all the radio button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllRadioButtons();
taskDialog.LoadRadioButtons(1001, 1005);
CTaskDialog::NavigateTo
Transfere o foco para outro CTaskDialog
.
protected:
void NavigateTo(CTaskDialog& oTaskDialog) const;
Parâmetros
oTaskDialog
[in] O CTaskDialog
que recebe o foco.
Comentários
Esse método oculta a corrente CTaskDialog
quando exibe o oTaskDialog. O oTaskDialog é exibido no mesmo local que o atual CTaskDialog
.
CTaskDialog::OnCommandControlClick
A estrutura chama esse método quando o usuário clica em um controle de botão de comando.
virtual HRESULT OnCommandControlClick(int nCommandControlID);
Parâmetros
nCommandControlID
[in] A ID do controle de botão de comando selecionado pelo usuário.
Valor Retornado
A implementação padrão retorna S_OK.
Comentários
Substitua esse método em uma classe derivada para implementar o comportamento personalizado.
CTaskDialog::OnCreate
A estrutura chama esse método depois de criar o CTaskDialog
.
virtual HRESULT OnCreate();
Valor Retornado
A implementação padrão retorna S_OK.
Comentários
Substitua esse método em uma classe derivada para implementar o comportamento personalizado.
CTaskDialog::OnDestroy
A estrutura chama esse método imediatamente antes de destruir o CTaskDialog
.
virtual HRESULT OnDestroy();
Valor Retornado
A implementação padrão retorna S_OK.
Comentários
Substitua esse método em uma classe derivada para implementar o comportamento personalizado.
CTaskDialog::OnExpandButtonClick
A estrutura chama esse método quando o usuário clica no botão de expansão.
virtual HRESULT OnExpandButtonClicked(BOOL bExpanded);
Parâmetros
bExpanded
[in] Um valor diferente de zero indica que as informações extras são exibidas; 0 indica que as informações extras estão ocultas.
Valor Retornado
A implementação padrão retorna S_OK.
Comentários
Substitua esse método em uma classe derivada para implementar o comportamento personalizado.
CTaskDialog::OnHelp
A estrutura chama esse método quando o usuário solicita ajuda.
virtual HRESULT OnHelp();
Valor Retornado
A implementação padrão retorna S_OK.
Comentários
Substitua esse método em uma classe derivada para implementar o comportamento personalizado.
CTaskDialog::OnHyperlinkClick
A estrutura chama esse método quando o usuário clica em um hiperlink.
virtual HRESULT OnHyperlinkClick(const CString& strHref);
Parâmetros
strHref
[in] A cadeia de caracteres que representa o hiperlink.
Valor Retornado
A implementação padrão retorna S_OK.
Comentários
Esse método chama ShellExecute antes de retornar S_OK.
Substitua esse método em uma classe derivada para implementar o comportamento personalizado.
CTaskDialog::OnInit
A estrutura chama esse método quando o CTaskDialog
método é inicializado.
virtual HRESULT OnInit();
Valor Retornado
A implementação padrão retorna S_OK.
Comentários
Substitua esse método em uma classe derivada para implementar o comportamento personalizado.
CTaskDialog::OnNavigatePage
A estrutura chama esse método em resposta ao método CTaskDialog::NavigateTo .
virtual HRESULT OnNavigatePage();
Valor Retornado
A implementação padrão retorna S_OK.
Comentários
Substitua esse método em uma classe derivada para implementar o comportamento personalizado.
CTaskDialog::OnRadioButtonClick
A estrutura chama esse método quando o usuário seleciona um controle de botão de opção.
virtual HRESULT OnRadioButtonClick(int nRadioButtonID);
Parâmetros
nRadioButtonID
[in] A ID do controle do botão de opção que o usuário clicou.
Valor Retornado
A implementação padrão retorna S_OK.
Comentários
Substitua esse método em uma classe derivada para implementar o comportamento personalizado.
CTaskDialog::OnTimer
A estrutura chama esse método quando o temporizador expira.
virtual HRESULT OnTimer(long lTime);
Parâmetros
lTime
[in] Tempo em milissegundos desde que o CTaskDialog
foi criado ou o temporizador foi redefinido.
Valor Retornado
A implementação padrão retorna S_OK.
Comentários
Substitua esse método em uma classe derivada para implementar o comportamento personalizado.
CTaskDialog::OnVerificationCheckboxClick
A estrutura chama esse método quando o usuário clica na caixa de seleção de verificação.
virtual HRESULT OnVerificationCheckboxClick(BOOL bChecked);
Parâmetros
bChecked
[in] TRUE indica que a caixa de seleção de verificação está selecionada; FALSE indica que não é.
Valor Retornado
A implementação padrão retorna S_OK.
Comentários
Substitua esse método em uma classe derivada para implementar o comportamento personalizado.
CTaskDialog::RemoveAllCommandControls
Remove todos os controles de botão de comando do CTaskDialog
.
void RemoveAllCommandControls();
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
taskDialog.AddCommandControl(201, L"First command button control");
taskDialog.AddCommandControl(202, L"Second command button control");
taskDialog.AddCommandControl(203, L"Third command button control");
// Show the CTaskDialog and remember how the user closed it.
int selection = taskDialog.DoModal();
switch (selection)
{
case 201:
// TODO: Place processing here for the first
// command button control.
break;
case 202:
// TODO: Place processing here for the second
// command button control.
break;
case 203:
// TODO: Place processing here for the third
// command button control.
break;
default:
break;
}
// Remove all the command controls so that we can use the same task
// dialog with new command button controls.
taskDialog.RemoveAllCommandControls();
taskDialog.AddCommandControl(301,
L"New first command button control");
taskDialog.AddCommandControl(302,
L"New second command button control should require elevation",
TRUE, TRUE);
taskDialog.AddCommandControl(303,
L"New third command button control should be disabled");
// Change the default command button control
taskDialog.SetDefaultCommandControl(302);
// Make sure the third option is disabled.
if (taskDialog.IsCommandControlEnabled(303))
{
taskDialog.SetCommandControlOptions(303, FALSE);
}
taskDialog.DoModal();
switch (taskDialog.GetSelectedCommandControlID())
{
case 301:
// TODO: Place processing here for new first
// command button control.
break;
case 302:
// TODO: Place processing here for new second
// command button control.
break;
case 303:
// TODO: Place processing here for the new third
// command button control.
break;
default:
break;
}
// Remove all the command button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllCommandControls();
taskDialog.LoadCommandControls(1001, 1005);
CTaskDialog::RemoveAllRadioButtons
Remove todos os botões de opção do CTaskDialog
.
void RemoveAllRadioButtons();
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
taskDialog.AddRadioButton(201, L"First option");
taskDialog.AddRadioButton(202, L"Second option");
taskDialog.AddRadioButton(203, L"Third option");
taskDialog.DoModal();
int selection = taskDialog.GetSelectedRadioButtonID();
switch (selection)
{
case 201:
// TODO: Place processing here for the first
// radio button.
break;
case 202:
// TODO: Place processing here for the second
// radio button.
break;
case 203:
// TODO: Place processing here for the third
// radio button.
break;
default:
break;
}
// Remove all the radio buttons so that we can use the same task
// dialog with new radio buttons.
taskDialog.RemoveAllRadioButtons();
taskDialog.AddRadioButton(301, L"New first option");
taskDialog.AddRadioButton(302, L"New second option");
taskDialog.AddRadioButton(303,
L"New third option should be disabled");
// Change the default radio button to the second option
taskDialog.SetDefaultRadioButton(302);
// Make sure the third option is disabled.
if (taskDialog.IsRadioButtonEnabled(303))
{
taskDialog.SetRadioButtonOptions(303, FALSE);
}
taskDialog.DoModal();
selection = taskDialog.GetSelectedRadioButtonID();
switch (taskDialog.GetSelectedRadioButtonID())
{
case 301:
// TODO: Place processing here for new first
// command button control.
break;
case 302:
// TODO: Place processing here for new second
// command button control.
break;
case 303:
// TODO: Place processing here for the new third
// command button control.
break;
default:
break;
}
// Remove all the radio button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllRadioButtons();
taskDialog.LoadRadioButtons(1001, 1005);
CTaskDialog::SetCommandControlOptions
Atualiza um controle de botão de comando no CTaskDialog
.
void SetCommandControlOptions(
int nCommandControlID,
BOOL bEnabled,
BOOL bRequiresElevation = FALSE);
Parâmetros
nCommandControlID
[in] A ID do controle de comando a ser atualizado.
bEnabled
[in] Um parâmetro booliano que indica se o controle de botão de comando especificado está habilitado ou desabilitado.
bRequiresElevation
[in] Um parâmetro booliano que indica se o controle de botão de comando especificado requer elevação.
Comentários
Use esse método para alterar se um controle de botão de comando está habilitado ou requer elevação depois de ter sido adicionado à CTaskDialog
classe.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
taskDialog.AddCommandControl(201, L"First command button control");
taskDialog.AddCommandControl(202, L"Second command button control");
taskDialog.AddCommandControl(203, L"Third command button control");
// Show the CTaskDialog and remember how the user closed it.
int selection = taskDialog.DoModal();
switch (selection)
{
case 201:
// TODO: Place processing here for the first
// command button control.
break;
case 202:
// TODO: Place processing here for the second
// command button control.
break;
case 203:
// TODO: Place processing here for the third
// command button control.
break;
default:
break;
}
// Remove all the command controls so that we can use the same task
// dialog with new command button controls.
taskDialog.RemoveAllCommandControls();
taskDialog.AddCommandControl(301,
L"New first command button control");
taskDialog.AddCommandControl(302,
L"New second command button control should require elevation",
TRUE, TRUE);
taskDialog.AddCommandControl(303,
L"New third command button control should be disabled");
// Change the default command button control
taskDialog.SetDefaultCommandControl(302);
// Make sure the third option is disabled.
if (taskDialog.IsCommandControlEnabled(303))
{
taskDialog.SetCommandControlOptions(303, FALSE);
}
taskDialog.DoModal();
switch (taskDialog.GetSelectedCommandControlID())
{
case 301:
// TODO: Place processing here for new first
// command button control.
break;
case 302:
// TODO: Place processing here for new second
// command button control.
break;
case 303:
// TODO: Place processing here for the new third
// command button control.
break;
default:
break;
}
// Remove all the command button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllCommandControls();
taskDialog.LoadCommandControls(1001, 1005);
CTaskDialog::SetCommonButtonOptions
Atualiza um subconjunto de botões comuns a serem habilitados e exigir a elevação do UAC.
void SetCommonButtonOptions(
int nDisabledButtonMask,
int nElevationButtonMask = 0);
Parâmetros
nDisabledButtonMask
[in] Uma máscara para os botões comuns desabilitarem.
nElevationButtonMask
[in] Uma máscara para os botões comuns que exigem elevação.
Comentários
Você pode definir os botões comuns disponíveis para uma instância da Classe CTaskDialog usando o construtor CTaskDialog::CTaskDialog e o método CTaskDialog::SetCommonButtons. CTaskDialog::SetCommonButtonOptions
não dá suporte à adição de novos botões comuns.
Se você usar esse método para desabilitar ou elevar um botão comum que não está disponível para isso CTaskDialog
, esse método lançará uma exceção usando a macro ENSURE .
Esse método habilita qualquer botão disponível para o CTaskDialog
nDisabledButtonMask, mesmo que ele tenha sido desabilitado anteriormente. Esse método trata a elevação de maneira semelhante: ele registra botões comuns como não exigindo elevação se o botão comum estiver disponível, mas não incluído em nElevationButtonMask.
Exemplo
// 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();
CTaskDialog::SetCommonButtons
Adiciona botões comuns ao CTaskDialog
.
void SetCommonButtons(
int nButtonMask,
int nDisabledButtonMask = 0,
int nElevationButtonMask = 0);
Parâmetros
nButtonMask
[in] Uma máscara dos botões a serem adicionados ao CTaskDialog
.
nDisabledButtonMask
[in] Uma máscara dos botões a serem desabilitados.
nElevationButtonMask
[in] Uma máscara dos botões que exigem elevação.
Comentários
Você não pode chamar esse método depois que a janela de exibição dessa instância da CTaskDialog
classe for criada. Se você fizer isso, esse método gerará uma exceção.
Os botões indicados por nButtonMask substituem todos os botões comuns adicionados anteriormente ao CTaskDialog
. Somente os botões indicados em nButtonMask estão disponíveis.
Se nDisabledButtonMask ou nElevationButtonMask contiverem um botão que não esteja em nButtonMask, esse método gerará uma exceção usando a macro ENSURE .
Por padrão, todos os botões comuns estão habilitados e não exigem elevação.
Exemplo
// 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();
CTaskDialog::SetContent
Atualiza o conteúdo do CTaskDialog
.
void SetContent(const CString& strContent);
Parâmetros
strContent
[in] A cadeia de caracteres a ser exibida para o usuário.
Comentários
O conteúdo da CTaskDialog
classe é o texto exibido para o usuário na seção principal da caixa de diálogo.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);
// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);
// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
L"Click here for more information.",
L"Click here to hide the extra information.");
// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);
taskDialog.DoModal();
CTaskDialog::SetDefaultCommandControl
Especifica o controle de botão de comando padrão.
void SetDefaultCommandControl(int nCommandControlID);
Parâmetros
nCommandControlID
[in] A ID do controle de botão de comando para ser o padrão.
Comentários
O controle de botão de comando padrão é o controle selecionado quando o CTaskDialog
usuário é exibido pela primeira vez.
Esse método gerará uma exceção se não encontrar o controle de botão de comando especificado por nCommandControlID.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
taskDialog.AddCommandControl(201, L"First command button control");
taskDialog.AddCommandControl(202, L"Second command button control");
taskDialog.AddCommandControl(203, L"Third command button control");
// Show the CTaskDialog and remember how the user closed it.
int selection = taskDialog.DoModal();
switch (selection)
{
case 201:
// TODO: Place processing here for the first
// command button control.
break;
case 202:
// TODO: Place processing here for the second
// command button control.
break;
case 203:
// TODO: Place processing here for the third
// command button control.
break;
default:
break;
}
// Remove all the command controls so that we can use the same task
// dialog with new command button controls.
taskDialog.RemoveAllCommandControls();
taskDialog.AddCommandControl(301,
L"New first command button control");
taskDialog.AddCommandControl(302,
L"New second command button control should require elevation",
TRUE, TRUE);
taskDialog.AddCommandControl(303,
L"New third command button control should be disabled");
// Change the default command button control
taskDialog.SetDefaultCommandControl(302);
// Make sure the third option is disabled.
if (taskDialog.IsCommandControlEnabled(303))
{
taskDialog.SetCommandControlOptions(303, FALSE);
}
taskDialog.DoModal();
switch (taskDialog.GetSelectedCommandControlID())
{
case 301:
// TODO: Place processing here for new first
// command button control.
break;
case 302:
// TODO: Place processing here for new second
// command button control.
break;
case 303:
// TODO: Place processing here for the new third
// command button control.
break;
default:
break;
}
// Remove all the command button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllCommandControls();
taskDialog.LoadCommandControls(1001, 1005);
CTaskDialog::SetDefaultRadioButton
Especifica o botão de opção padrão.
void SetDefaultRadioButton(int nRadioButtonID);
Parâmetros
nRadioButtonID
[in] A ID do botão de opção para ser o padrão.
Comentários
O botão de opção padrão é o botão selecionado quando ele CTaskDialog
é exibido pela primeira vez para o usuário.
Esse método gerará uma exceção se não encontrar o botão de opção especificado por nRadioButtonID.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
taskDialog.AddRadioButton(201, L"First option");
taskDialog.AddRadioButton(202, L"Second option");
taskDialog.AddRadioButton(203, L"Third option");
taskDialog.DoModal();
int selection = taskDialog.GetSelectedRadioButtonID();
switch (selection)
{
case 201:
// TODO: Place processing here for the first
// radio button.
break;
case 202:
// TODO: Place processing here for the second
// radio button.
break;
case 203:
// TODO: Place processing here for the third
// radio button.
break;
default:
break;
}
// Remove all the radio buttons so that we can use the same task
// dialog with new radio buttons.
taskDialog.RemoveAllRadioButtons();
taskDialog.AddRadioButton(301, L"New first option");
taskDialog.AddRadioButton(302, L"New second option");
taskDialog.AddRadioButton(303,
L"New third option should be disabled");
// Change the default radio button to the second option
taskDialog.SetDefaultRadioButton(302);
// Make sure the third option is disabled.
if (taskDialog.IsRadioButtonEnabled(303))
{
taskDialog.SetRadioButtonOptions(303, FALSE);
}
taskDialog.DoModal();
selection = taskDialog.GetSelectedRadioButtonID();
switch (taskDialog.GetSelectedRadioButtonID())
{
case 301:
// TODO: Place processing here for new first
// command button control.
break;
case 302:
// TODO: Place processing here for new second
// command button control.
break;
case 303:
// TODO: Place processing here for the new third
// command button control.
break;
default:
break;
}
// Remove all the radio button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllRadioButtons();
taskDialog.LoadRadioButtons(1001, 1005);
CTaskDialog::SetDialogWidth
Ajusta a largura do CTaskDialog
.
void SetDialogWidth(int nWidth = 0);
Parâmetros
Nwidth
[in] A largura da caixa de diálogo, em pixels.
Comentários
O parâmetro nWidth deve ser maior ou igual a 0. Caso contrário, esse método gera uma exceção.
Se nWidth for definido como 0, esse método definirá a caixa de diálogo como o tamanho padrão.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);
// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);
// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
L"Click here for more information.",
L"Click here to hide the extra information.");
// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);
taskDialog.DoModal();
CTaskDialog::SetExpansionArea
Atualiza a área de expansão da CTaskDialog
.
void SetExpansionArea(
const CString& strExpandedInformation,
const CString& strCollapsedLabel = _T(""),
const CString& strExpandedLabel = _T(""));
Parâmetros
strExpandedInformation
[in] A cadeia de caracteres exibida CTaskDialog
no corpo principal da caixa de diálogo quando o usuário clica no botão de expansão.
strCollapsedLabel
[in] A cadeia de caracteres exibida CTaskDialog
ao lado do botão de expansão quando a área expandida é recolhida.
strExpandedLabel
[in] A cadeia de caracteres exibida CTaskDialog
ao lado do botão de expansão quando a área expandida é exibida.
Comentários
A área de expansão da CTaskDialog
classe permite que você forneça informações adicionais ao usuário. A área de expansão está na parte principal do CTaskDialog
, localizado imediatamente abaixo do título e da cadeia de caracteres de conteúdo.
Quando exibido CTaskDialog
pela primeira vez, ele não mostra as informações expandidas e coloca strCollapsedLabel
ao lado do botão de expansão. Quando o usuário clica no botão de expansão, ele CTaskDialog
exibe strExpandedInformation e altera o rótulo para strExpandedLabel.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);
// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);
// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
L"Click here for more information.",
L"Click here to hide the extra information.");
// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);
taskDialog.DoModal();
CTaskDialog::SetFooterIcon
Atualiza o ícone de rodapé do CTaskDialog
.
void SetFooterIcon(HICON hFooterIcon);
void SetFooterIcon(LPCWSTR lpszFooterIcon);
Parâmetros
hFooterIcon
[in] O novo ícone para o CTaskDialog
.
lpszFooterIcon
[in] O novo ícone para o CTaskDialog
.
Comentários
O ícone de rodapé é exibido na parte inferior da Classe CTaskDialog. Ele pode ter texto do rodapé associado. Você pode alterar o texto do rodapé com CTaskDialog::SetFooterText.
Esse método gera uma exceção com a macro ENSURE se a CTaskDialog
opção for exibida ou o parâmetro de entrada for NULL.
Uma CTaskDialog
só pode aceitar um HICON
ícone de rodapé ou LPCWSTR
como rodapé. Isso é configurado definindo a opção TDF_USE_HICON_FOOTER no construtor ou CTaskDialog::SetOptions. Por padrão, o CTaskDialog
valor é configurado para ser usado LPCWSTR
como o tipo de entrada para o ícone de rodapé. Esse método gera uma exceção se você tentar definir o ícone usando o tipo inadequado.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);
// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);
// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
L"Click here for more information.",
L"Click here to hide the extra information.");
// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);
taskDialog.DoModal();
CTaskDialog::SetFooterText
Atualiza o texto no rodapé do CTaskDialog
.
void SetFooterText(const CString& strFooterText);
Parâmetros
strFooterText
[in] O novo texto para o rodapé.
Comentários
O ícone de rodapé aparece ao lado do texto do rodapé na parte inferior do CTaskDialog
. Você pode alterar o ícone de rodapé com CTaskDialog::SetFooterIcon.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);
// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);
// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
L"Click here for more information.",
L"Click here to hide the extra information.");
// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);
taskDialog.DoModal();
CTaskDialog::SetMainIcon
Atualiza o ícone principal do CTaskDialog
.
void SetMainIcon(HICON hMainIcon);
void SetMainIcon(LPCWSTR lpszMainIcon);
Parâmetros
hMainIcon
[in] O novo ícone.
lpszMainIcon
[in] O novo ícone.
Comentários
Esse método gera uma exceção com a macro ENSURE se a CTaskDialog
opção for exibida ou o parâmetro de entrada for NULL.
A CTaskDialog
só pode aceitar um HICON
ícone ou LPCWSTR
como um ícone principal. Você pode configurar isso definindo a opção TDF_USE_HICON_MAIN no construtor ou no método CTaskDialog::SetOptions . Por padrão, ele CTaskDialog
é configurado para usar LPCWSTR
como o tipo de entrada para o ícone principal. Esse método gera uma exceção se você tentar definir o ícone usando o tipo inadequado.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);
// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);
// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
L"Click here for more information.",
L"Click here to hide the extra information.");
// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);
taskDialog.DoModal();
CTaskDialog::SetMainInstruction
Atualiza a instrução principal do CTaskDialog
.
void SetMainInstruction(const CString& strInstructions);
Parâmetros
strInstructions
[in] A nova instrução principal.
Comentários
A instrução principal da classe é o CTaskDialog
texto exibido para o usuário em uma fonte grande em negrito. Ele está localizado na caixa de diálogo abaixo da barra de título.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);
// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);
// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
L"Click here for more information.",
L"Click here to hide the extra information.");
// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);
taskDialog.DoModal();
CTaskDialog::SetOptions
Configura as opções para o CTaskDialog
.
void SetOptions(int nOptionFlag);
Parâmetros
nOptionFlag
[in] O conjunto de sinalizadores a serem usados para o CTaskDialog
.
Comentários
Esse método limpa todas as opções atuais para o CTaskDialog
. Para preservar as opções atuais, você deve recuperá-las primeiro com CTaskDialog::GetOptions e combiná-las com as opções que deseja definir.
A tabela a seguir lista todas as opções válidas.
Nome | Descrição |
---|---|
TDF_ENABLE_HYPERLINKS | Habilita hiperlinks no CTaskDialog . |
TDF_USE_HICON_MAIN | Configura o CTaskDialog ícone para usar um HICON para o ícone principal. A alternativa é usar um LPCWSTR . |
TDF_USE_HICON_FOOTER | Configura o CTaskDialog ícone para usar um HICON para o rodapé. A alternativa é usar um LPCWSTR . |
TDF_ALLOW_DIALOG_CANCELLATION | Permite que o usuário feche CTaskDialog usando o teclado ou usando o ícone no canto superior direito da caixa de diálogo, mesmo que o botão Cancelar não esteja habilitado. Se esse sinalizador não estiver definido e o botão Cancelar não estiver habilitado, o usuário não poderá fechar a caixa de diálogo usando Alt+F4, a tecla Escape ou o botão fechar da barra de título. |
TDF_USE_COMMAND_LINKS | Configura os controles de CTaskDialog botão de comando para usar. |
TDF_USE_COMMAND_LINKS_NO_ICON | Configura os CTaskDialog controles de botão de comando para usar sem exibir um ícone ao lado do controle. TDF_USE_COMMAND_LINKS substitui TDF_USE_COMMAND_LINKS_NO_ICON. |
TDF_EXPAND_FOOTER_AREA | Indica que a área de expansão está expandida no momento. |
TDF_EXPANDED_BY_DEFAULT | Determina se a área de expansão é expandida por padrão. |
TDF_VERIFICATION_FLAG_CHECKED | Indica que a caixa de seleção de verificação está selecionada no momento. |
TDF_SHOW_PROGRESS_BAR | Configura a CTaskDialog barra de progresso para exibir. |
TDF_SHOW_MARQUEE_PROGRESS_BAR | Configura a barra de progresso para ser uma barra de progresso de marquise. Se você habilitar essa opção, deverá definir TDF_SHOW_PROGRESS_BAR para ter o comportamento esperado. |
TDF_CALLBACK_TIMER | Indica que o CTaskDialog intervalo de retorno de chamada é definido como aproximadamente 200 milissegundos. |
TDF_POSITION_RELATIVE_TO_WINDOW | Configura a CTaskDialog centralidade em relação à janela pai. Se esse sinalizador não estiver habilitado, ele CTaskDialog será centralizado em relação ao monitor. |
TDF_RTL_LAYOUT | Configura o layout de leitura da CTaskDialog direita para a esquerda. |
TDF_NO_DEFAULT_RADIO_BUTTON | Indica que nenhum botão de opção é selecionado quando o CTaskDialog botão é exibido. |
TDF_CAN_BE_MINIMIZED | Permite que o usuário minimize o CTaskDialog . Para dar suporte a essa opção, não CTaskDialog pode ser modal. O MFC não dá suporte a essa opção porque o MFC não dá suporte a uma modelagem CTaskDialog . |
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);
// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);
// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
L"Click here for more information.",
L"Click here to hide the extra information.");
// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);
taskDialog.DoModal();
CTaskDialog::SetProgressBarMarquee
Configura uma barra de marquise para a CTaskDialog
caixa de diálogo e a adiciona à caixa de diálogo.
void SetProgressBarMarquee(
BOOL bEnabled = TRUE,
int nMarqueeSpeed = 0);
Parâmetros
bEnabled
[in] TRUE para habilitar a barra de marquise; FALSE para desabilitar a barra de marquise e removê-la do CTaskDialog
.
nMarqueeSpeed
[in] Um inteiro que indica a velocidade da barra de marquise.
Comentários
A barra de marquise aparece sob o texto principal da CTaskDialog
classe.
Use nMarqueeSpeed para definir a velocidade da barra de marquise; valores maiores indicam uma velocidade mais lenta. Um valor 0 para nMarqueeSpeed faz com que a barra de marquise se mova na velocidade padrão para Windows.
Esse método gera uma exceção com a macro ENSURE se nMarqueeSpeed for menor que 0.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
// Add a marquee progress bar.
taskDialog.SetProgressBarMarquee();
taskDialog.DoModal();
// Remove the marquee bar and replace it with a standard progress bar
taskDialog.SetProgressBarMarquee(0);
taskDialog.SetProgressBarRange(0, 100);
taskDialog.SetProgressBarPosition(75);
taskDialog.SetProgressBarState();
taskDialog.DoModal();
CTaskDialog::SetProgressBarPosition
Ajusta a posição da barra de progresso.
void SetProgressBarPosition(int nProgressPos);
Parâmetros
nProgressPos
[in] A posição da barra de progresso.
Comentários
Esse método gera uma exceção com a macro ENSURE se nProgressPos não estiver no intervalo de barras de progresso. Você pode alterar o intervalo de barras de progresso com CTaskDialog::SetProgressBarRange.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
// Add a marquee progress bar.
taskDialog.SetProgressBarMarquee();
taskDialog.DoModal();
// Remove the marquee bar and replace it with a standard progress bar
taskDialog.SetProgressBarMarquee(0);
taskDialog.SetProgressBarRange(0, 100);
taskDialog.SetProgressBarPosition(75);
taskDialog.SetProgressBarState();
taskDialog.DoModal();
CTaskDialog::SetProgressBarRange
Ajusta o intervalo da barra de progresso.
void SetProgressBarRange(
int nRangeMin,
int nRangeMax);
Parâmetros
nRangeMin
[in] O limite inferior da barra de progresso.
nRangeMax
[in] O limite superior da barra de progresso.
Comentários
A posição da barra de progresso é relativa a nRangeMin e nRangeMax. Por exemplo, se nRangeMin for 50 e nRangeMax for 100, uma posição de 75 estará na metade da barra de progresso. Use CTaskDialog::SetProgressBarPosition para definir a posição da barra de progresso.
Para exibir a barra de progresso, a opção TDF_SHOW_PROGRESS_BAR deve estar habilitada e TDF_SHOW_MARQUEE_PROGRESS_BAR não deve ser habilitada. Esse método define automaticamente TDF_SHOW_PROGRESS_BAR e limpa TDF_SHOW_MARQUEE_PROGRESS_BAR. Use CTaskDialog::SetOptions para alterar manualmente as opções para esta instância da Classe CTaskDialog.
Esse método gera uma exceção com a macro ENSURE se nRangeMin não for menor que nRangeMax. Esse método também gerará uma exceção se o CTaskDialog
já estiver exibido e tiver uma barra de progresso de letreiro.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
// Add a marquee progress bar.
taskDialog.SetProgressBarMarquee();
taskDialog.DoModal();
// Remove the marquee bar and replace it with a standard progress bar
taskDialog.SetProgressBarMarquee(0);
taskDialog.SetProgressBarRange(0, 100);
taskDialog.SetProgressBarPosition(75);
taskDialog.SetProgressBarState();
taskDialog.DoModal();
CTaskDialog::SetProgressBarState
Define o estado da barra de progresso e exibe-o CTaskDialog
no .
void SetProgressBarState(int nState = PBST_NORMAL);
Parâmetros
Nstate
[in] O estado da barra de progresso. Consulte a seção Comentários para obter os valores possíveis.
Comentários
Esse método gera uma exceção com a macro ENSURE se a CTaskDialog
já estiver exibida e tiver uma barra de progresso de letreiro.
A tabela a seguir lista os valores possíveis para nState. Em todos esses casos, a barra de progresso será preenchida com a cor regular até atingir a posição de parada designada. Nesse ponto, ele mudará de cor com base no estado.
Nome | Descrição |
---|---|
PBST_NORMAL | Após o preenchimento da barra de progresso, a CTaskDialog cor da barra não é alterada. Por padrão, a cor regular é verde. |
PBST_ERROR | Após o preenchimento da barra de progresso, a CTaskDialog cor da barra será alterada para a cor do erro. Por padrão, isso é vermelho. |
PBST_PAUSED | Após o preenchimento da barra de progresso, a CTaskDialog cor da barra será alterada para a cor pausada. Por padrão, isso é amarelo. |
Você pode definir onde a barra de progresso para com CTaskDialog::SetProgressBarPosition.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
// Add a marquee progress bar.
taskDialog.SetProgressBarMarquee();
taskDialog.DoModal();
// Remove the marquee bar and replace it with a standard progress bar
taskDialog.SetProgressBarMarquee(0);
taskDialog.SetProgressBarRange(0, 100);
taskDialog.SetProgressBarPosition(75);
taskDialog.SetProgressBarState();
taskDialog.DoModal();
CTaskDialog::SetRadioButtonOptions
Habilita ou desabilita um botão de opção.
void SetRadioButtonOptions(
int nRadioButtonID,
BOOL bEnabled);
Parâmetros
nRadioButtonID
[in] A ID do controle de botão de opção.
bEnabled
[in] TRUE para habilitar o botão de opção; FALSE para desabilitar o botão de opção.
Comentários
Esse método gera uma exceção com a macro ENSURE se nRadioButtonID não for uma ID válida para um botão de opção.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
taskDialog.AddRadioButton(201, L"First option");
taskDialog.AddRadioButton(202, L"Second option");
taskDialog.AddRadioButton(203, L"Third option");
taskDialog.DoModal();
int selection = taskDialog.GetSelectedRadioButtonID();
switch (selection)
{
case 201:
// TODO: Place processing here for the first
// radio button.
break;
case 202:
// TODO: Place processing here for the second
// radio button.
break;
case 203:
// TODO: Place processing here for the third
// radio button.
break;
default:
break;
}
// Remove all the radio buttons so that we can use the same task
// dialog with new radio buttons.
taskDialog.RemoveAllRadioButtons();
taskDialog.AddRadioButton(301, L"New first option");
taskDialog.AddRadioButton(302, L"New second option");
taskDialog.AddRadioButton(303,
L"New third option should be disabled");
// Change the default radio button to the second option
taskDialog.SetDefaultRadioButton(302);
// Make sure the third option is disabled.
if (taskDialog.IsRadioButtonEnabled(303))
{
taskDialog.SetRadioButtonOptions(303, FALSE);
}
taskDialog.DoModal();
selection = taskDialog.GetSelectedRadioButtonID();
switch (taskDialog.GetSelectedRadioButtonID())
{
case 301:
// TODO: Place processing here for new first
// command button control.
break;
case 302:
// TODO: Place processing here for new second
// command button control.
break;
case 303:
// TODO: Place processing here for the new third
// command button control.
break;
default:
break;
}
// Remove all the radio button controls and add new ones from
// the string table resource.
taskDialog.RemoveAllRadioButtons();
taskDialog.LoadRadioButtons(1001, 1005);
CTaskDialog::SetVerificationCheckbox
Define o estado marcado da caixa de seleção de verificação.
void SetVerificationCheckbox(BOOL bChecked);
Parâmetros
bChecked
[in] TRUE para que a caixa de seleção de verificação seja selecionada quando ela CTaskDialog
for exibida; FALSE para que a caixa de seleção de verificação não seja selecionada quando ela CTaskDialog
for exibida.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
// Add the verification checkbox and set the default state.
taskDialog.SetVerificationCheckboxText(L"Remember your selection.");
taskDialog.SetVerificationCheckbox(false);
taskDialog.DoModal();
if (taskDialog.GetVerificationCheckboxState())
{
// TODO: Write settings of the task dialog to the registry
}
CTaskDialog::SetVerificationCheckboxText
Define o texto exibido à direita da caixa de seleção de verificação.
void SetVerificationCheckboxText(CString& strVerificationText);
Parâmetros
strVerificationText
[in] O texto que esse método exibe ao lado da caixa de seleção de verificação.
Comentários
Esse método gera uma exceção com a macro ENSURE se essa instância da CTaskDialog
classe já estiver exibida.
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
// Add the verification checkbox and set the default state.
taskDialog.SetVerificationCheckboxText(L"Remember your selection.");
taskDialog.SetVerificationCheckbox(false);
taskDialog.DoModal();
if (taskDialog.GetVerificationCheckboxState())
{
// TODO: Write settings of the task dialog to the registry
}
CTaskDialog::SetWindowTitle
Define o título do CTaskDialog
.
void SetWindowTitle(CString& strWindowTitle);
Parâmetros
strWindowTitle
[in] O novo título para o CTaskDialog
.
Comentários
Exemplo
// 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,
TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON);
// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);
// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);
// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
L"Click here for more information.",
L"Click here to hide the extra information.");
// Change the options to show the expanded information by default.
// It is necessary to retrieve the current options first.
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);
taskDialog.DoModal();
CTaskDialog::ShowDialog
Cria e exibe um CTaskDialog
.
static INT_PTR ShowDialog(
const CString& strContent,
const CString& strMainInstruction,
const CString& strTitle,
int nIDCommandControlsFirst,
int nIDCommandControlsLast,
int nCommonButtons = TDCBF_YES_BUTTON | TDCBF_NO_BUTTON,
int nTaskDialogOptions = TDF_ENABLE_HYPERLINKS | TDF_USE_COMMAND_LINKS,
const CString& strFooter = _T(""));
Parâmetros
strContent
[in] A cadeia de caracteres a ser usada para o conteúdo do CTaskDialog
.
strMainInstruction
[in] A instrução principal do CTaskDialog
.
strTitle
[in] O título do CTaskDialog
.
nIDCommandControlsFirst
[in] A ID da cadeia de caracteres do primeiro comando.
nIDCommandControlsLast
[in] A ID da cadeia de caracteres do último comando.
nCommonButtons
[in] Uma máscara dos botões a serem adicionados ao CTaskDialog
.
nTaskDialogOptions
[in] O conjunto de opções a ser usado para o CTaskDialog
.
strFooter
[in] A cadeia de caracteres a ser usada como rodapé.
Valor Retornado
Um inteiro que corresponde à seleção feita pelo usuário.
Comentários
Esse método estático permite que você crie uma instância da CTaskDialog
classe sem criar explicitamente um CTaskDialog
objeto em seu código. Como não há nenhum CTaskDialog
objeto, você não pode chamar nenhum outro método do CTaskDialog
método se você usar esse método para mostrar um CTaskDialog
para o usuário.
Esse método cria controles de botão de comando usando dados do arquivo de recurso do aplicativo. A tabela de cadeia de caracteres no arquivo de recurso tem várias cadeias de caracteres com IDs de cadeia de caracteres associadas. Esse método adiciona um controle de botão de comando para cada entrada válida na tabela de cadeia de caracteres entre nIDCommandControlsFirst e nCommandControlsLast, inclusive. Para esses controles de botão de comando, a cadeia de caracteres na tabela de cadeia de caracteres é a legenda do controle e a ID da cadeia de caracteres é a ID do controle.
Consulte CTaskDialog::SetOptions para obter uma lista de opções válidas.
Fecha CTaskDialog
quando o usuário seleciona um botão comum, um controle de link de comando ou fecha o CTaskDialog
. O valor retornado é o identificador que indica como o usuário fechou a caixa de diálogo.
Exemplo
// 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);
}
CTaskDialog::TaskDialogCallback
A estrutura chama esse método em resposta a várias mensagens Windows.
friend:
HRESULT TaskDialogCallback(
HWND hWnd,
UINT uNotification,
WPARAM wParam,
LPARAM lParam,
LONG_PTR dwRefData);
Parâmetros
Hwnd
[in] Um identificador para a m_hWnd
estrutura do CTaskDialog
.
uNotification
[in] O código de notificação que especifica a mensagem gerada.
wParam
[in] Mais informações sobre a mensagem.
lParam
[in] Mais informações sobre a mensagem.
dwRefData
[in] Um ponteiro para o CTaskDialog
objeto ao qual a mensagem de retorno de chamada se aplica.
Valor Retornado
Depende do código de notificação específico. Consulte a seção Comentários para obter mais informações.
Comentários
A implementação TaskDialogCallback
padrão manipula a mensagem específica e chama o método On apropriado da Classe CTaskDialog. Por exemplo, em resposta à mensagem TDN_BUTTON_CLICKED, TaskDialogCallback
chama CTaskDialog::OnCommandControlClick.
Os valores para wParam e lParam dependem da mensagem gerada específica. É possível que ambos ou ambos os valores estejam vazios. A tabela a seguir lista as notificações padrão com suporte e o que os valores de wParam e lParam representam. Se você substituir esse método em uma classe derivada, deverá implementar o código de retorno de chamada para cada mensagem na tabela a seguir.
Mensagem de Notificação | Wparam Valor | Lparam Valor |
---|---|---|
TDN_CREATED | Não usado. | Não usado. |
TDN_NAVIGATED | Não usado. | Não usado. |
TDN_BUTTON_CLICKED | A ID de controle do botão de comando. | Não usado. |
TDN_HYPERLINK_CLICKED | Não usado. | Uma estrutura LPCWSTR que contém o link. |
TDN_TIMER | Tempo em milissegundos desde que o CTaskDialog foi criado ou o temporizador foi redefinido. |
Não usado. |
TDN_DESTROYED | Não usado. | Não usado. |
TDN_RADIO_BUTTON_CLICKED | A ID do botão de opção. | Não usado. |
TDN_DIALOG_CONSTRUCTED | Não usado. | Não usado. |
TDN_VERIFICATION_CLICKED | 1 se a caixa de seleção estiver marcada, 0 se não estiver. | Não usado. |
TDN_HELP | Não usado. | Não usado. |
TDN_EXPANDO_BUTTON_CLICKED | 0 se a área de expansão for recolhida; nonzero se o texto de expansão for exibido. | Não usado. |
Confira também
Classes
Classe CObject
Gráfico de Hierarquia
Passo a passo: adicionando um CTaskDialog a um aplicativo