CTaskDialog Classe
Uma caixa de diálogo pop-up que funciona como uma caixa de mensagem, mas pode exibir informações adicionais para o usuário. O CTaskDialog
também inclui funcionalidade para coletar informações do usuário.
Sintaxe
class CTaskDialog : public CObject
Membros
Construtores
Designação | Descrição |
---|---|
CTaskDialog::CTaskDialog | Constrói um objeto CTaskDialog . |
Metodologia
Designação | Descrição |
---|---|
CTaskDialog::AddCommandControl | Adiciona um controle de botão de comando ao CTaskDialog . |
CTaskDialog::AddRadioButton | Adiciona um botão de opção ao CTaskDialog . |
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 padrão do Windows para o tipo de botão comum associado à classe CTaskDialog . |
CTaskDialog::GetCommonButtonId | Converte um dos tipos de botão comuns associados à classe CTaskDialog em um botão padrão do Windows. |
CTaskDialog::GetOptions | Retorna os sinalizadores de opção para este 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 suporta o 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::OnCommandControlClique | 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 que ele cria o CTaskDialog . |
CTaskDialog::OnDestroy | A estrutura chama esse método imediatamente antes de destruir o CTaskDialog . |
CTaskDialog::OnExpandButtonClique | 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 é inicializado. |
CTaskDialog::OnNavigatePage | A estrutura chama esse método quando o usuário move o foco em relação aos controles no CTaskDialog . |
CTaskDialog::OnRadioButtonClique | 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::OnVerificationCheckboxClique | 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 para serem habilitados e exigem elevação do 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 do 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 letreiro para o CTaskDialog 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-a no CTaskDialog . |
CTaskDialog::SetRadioButtonOptions | Ativa ou desativa um botão de opção. |
CTaskDialog::SetVerificationCheckbox | Define o estado verificado 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 do Windows. |
Membros de dados
Designação | 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 |
Uma alça para a janela para o CTaskDialog . |
m_mainIcon |
O ícone principal do CTaskDialog . |
m_nButtonDisabled |
Uma máscara que indica quais dos botões comuns estão desativados. |
m_nButtonElevation |
Uma máscara que indica qual dos botões comuns requer elevação do 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 de botão de comando que é selecionado quando o CTaskDialog é exibido. |
m_nDefaultRadioButton |
A ID do controle de botão de opção que é selecionado quando o CTaskDialog é exibido. |
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 do CTaskDialog em pixels. |
m_strCollapse |
A cadeia de caracteres que o CTaskDialog exibe à 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 que o CTaskDialog exibe à direita da caixa de expansão quando as informações expandidas são exibidas. |
m_strFooter |
O rodapé do CTaskDialog . |
m_strInformation |
A informação expandida para o CTaskDialog . |
m_strMainInstruction |
A principal instrução do CTaskDialog . |
m_strTitle |
O título do CTaskDialog . |
m_strVerification |
A cadeia de caracteres que o CTaskDialog exibe à direita da caixa de seleção de verificação. |
Comentários
A classe CTaskDialog
substitui a caixa de mensagem padrão do Windows e tem funcionalidade adicional, como novos controles para coletar informações do usuário. Esta classe está na biblioteca MFC no Visual Studio 2010 e posterior. O CTaskDialog
está disponível a partir do Windows Vista. Versões anteriores do Windows não podem exibir o objeto CTaskDialog
. Use CTaskDialog::IsSupported
para determinar em tempo de execução se o usuário atual pode exibir a caixa de diálogo da tarefa. A caixa de mensagem padrão do Windows ainda é suportada.
O 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 suporta 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 de CTaskDialog
para ilustrar a localização de alguns dos controles.
CTaskDialog
Exemplo de CTaskDialog
Requerimentos
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
[em] O número de identificação do controlo de comando.
strCaption
[em] A cadeia de caracteres que o CTaskDialog
exibe para o usuário. Use esta cadeia de caracteres para explicar a finalidade do comando.
bEnabled
[em] Um parâmetro booleano que indica se o novo botão está ativado ou desativado.
bRequiresElevation
[em] Um parâmetro booleano que indica se um comando requer elevação.
Comentários
O CTaskDialog Class
pode exibir um número ilimitado de controles de botão de comando. No entanto, se um CTaskDialog
exibir qualquer controle de botão de comando, ele pode exibir um máximo de 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, o CTaskDialog
é fechado. Se seu 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
[em] O número de identificação do botão de opção.
strCaption
[em] A cadeia de caracteres que o CTaskDialog
exibe ao lado do botão de opção.
bEnabled
[em] Um parâmetro booleano que indica se o botão de opção está habilitado.
Comentários
Os botões de opção para o CTaskDialog Class permitir que você colete informações do usuário. Use a função CTaskDialog::GetSelectedRadioButtonID para determinar qual botão de opção está selecionado.
O CTaskDialog
não requer que os parâmetros nRadioButtonID sejam exclusivos para cada botão de opção. No entanto, você pode enfrentar um comportamento inesperado se você 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
[em] O ID de comando do controle para clicar.
Comentários
Este 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
[em] O ID do botão de opção para clicar.
Comentários
Este método gera a mensagem do Windows TDM_CLICK_RADIO_BUTTON.
CTaskDialog::CTaskDialog
Cria uma instância do CTaskDialog Class.
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
[em] A cadeia de caracteres a ser usada para o conteúdo do CTaskDialog
.
strMainInstruction
[em] A principal instrução do CTaskDialog
.
strTitle
[em] O título do CTaskDialog
.
nCommonButtons
[em] Uma máscara dos botões comuns para adicionar ao CTaskDialog
.
nTaskDialogOptions
[em] O conjunto de opções a utilizar para o CTaskDialog
.
strFooter
[em] A cadeia de caracteres a ser usada como rodapé.
nIDCommandControlsFirst
[em] A ID da cadeia de caracteres do primeiro comando.
nIDCommandControlsÚltima
[em] 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 objeto CTaskDialog
.
O segundo construtor cria controles de botão de comando usando dados do arquivo de recurso do seu 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 torna-o modal.
INT_PTR DoModal (HWND hParent = ::GetActiveWindow());
Parâmetros
hParent
[em] A janela pai para o CTaskDialog
.
Valor de retorno
Um inteiro que corresponde à seleção feita pelo usuário.
Comentários
Exibe esta instância do CTaskDialog. Em seguida, o aplicativo aguarda que o usuário feche a caixa de diálogo.
O CTaskDialog
fecha quando o usuário seleciona um botão comum, um controle de link de comando ou fecha o CTaskDialog
. O valor de retorno é 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 de retorno
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 para CTaskDialog::CTaskDialog. O CTaskDialog Class 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 padrão do Windows para o tipo de botão comum associado ao CTaskDialog Class.
int GetCommonButtonFlag(int nButtonId) const;
Parâmetros
nButtonId
[em] O valor padrão do botão do Windows.
Valor de retorno
O valor do botão CTaskDialog
comum correspondente. Se não houver nenhum botão comum correspondente, esse método retornará 0.
CTaskDialog::GetCommonButtonId
Converte um dos tipos de botão comuns associados ao de classe CTaskDialog em um botão padrão do Windows.
int GetCommonButtonId(int nFlag);
Parâmetros
nFlag
[em] O tipo de botão comum associado à classe CTaskDialog
.
Valor de retorno
O valor do botão padrão do Windows correspondente. Se não houver nenhum botão correspondente do Windows, o método retornará 0.
CTaskDialog::GetOptions
Retorna os sinalizadores de opção para este CTaskDialog
.
int GetOptions() const;
Valor de retorno
As bandeiras para o CTaskDialog
.
Comentários
Para obter mais informações sobre as opções disponíveis para o CTaskDialog Class, 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 de retorno
A ID do controle de botão de comando selecionado no momento.
Comentários
Não é necessário usar esse método para recuperar a ID do botão de comando que o usuário selecionou. Essa ID é retornada pelo 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 de retorno
O ID do botão de opção selecionado.
Comentários
Você pode usar esse método depois que o usuário fecha 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 de retorno
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 controle ou botão de botão de comando está habilitado.
BOOL IsCommandControlEnabled(int nCommandControlID) const;
Parâmetros
nCommandControlID
[em] A ID do controle do botão de comando ou botão a ser testado.
Valor de retorno
TRUE se o controle estiver habilitado, FALSE se não estiver.
Comentários
Você pode usar esse método para determinar a disponibilidade de controles de botão de comando e os botões comuns da classe CTaskDialog
*.
Se nCommandControlID não for um identificador válido para um botão CTaskDialog
comum ou um controle de botão de comando, esse método lançará 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
[em] A ID do botão de opção a ser testado.
Valor de retorno
TRUE se o botão de opção estiver ativado, 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 lançará 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 suporta o CTaskDialog
.
static BOOL IsSupported();
Valor de retorno
TRUE se o computador suporta o CTaskDialog
; FALSO caso contrário.
Comentários
Use essa função para determinar em tempo de execução se o computador que está executando seu aplicativo suporta a classe CTaskDialog
. Se o computador não suportar o CTaskDialog
, deve fornecer outro método de comunicação de informações ao utilizador. Seu aplicativo falhará se tentar usar um CTaskDialog
em um computador que não suporta a classe CTaskDialog
.
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
[em] A ID da cadeia de caracteres do primeiro comando.
nIDCommandControlsÚltima
[em] 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 seu 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 selecionado é fornecido pelo nIDCommandControlsFirst e nCommandControlsLast, inclusive. Se houver uma entrada vazia no intervalo, o método não adiciona um controle de botão de comando para essa entrada.
Por padrão, os novos controles de botão de comando sã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
nIDRadioButtonsPrimeira
[em] O ID da cadeia de caracteres do primeiro botão de opção.
nIDRadioButtonsÚltima
[em] O 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 seu aplicativo. A tabela de cadeia de caracteres no arquivo de recurso tem várias cadeias de caracteres com IDs de cadeia de caracteres associadas. Os 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 o ID da cadeia de caracteres para a ID do botão de opção. O intervalo de strings selecionado é fornecido pelo nIDRadioButtonsFirst e nRadioButtonsLast, inclusive. Se houver uma entrada vazia no intervalo, o método não adiciona um botão de opção para essa entrada.
Por padrão, os novos botões de opção são ativados.
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
[em] O CTaskDialog
que recebe o foco.
Comentários
Esse método oculta o CTaskDialog
atual quando exibe o oTaskDialog. O oTaskDialog é exibido no mesmo local que o CTaskDialog
atual.
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
[em] A ID do controle de botão de comando que o usuário selecionou.
Valor de retorno
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 que ele cria o CTaskDialog
.
virtual HRESULT OnCreate();
Valor de retorno
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 de retorno
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
bExpandida
[em] Um valor diferente de zero indica que as informações extras são exibidas; 0 indica que as informações adicionais estão ocultas.
Valor de retorno
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 de retorno
A implementação padrão retorna S_FALSE.
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
[em] A cadeia de caracteres que representa o hiperlink.
Valor de retorno
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
é inicializado.
virtual HRESULT OnInit();
Valor de retorno
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 CTaskDialog::NavigateTo método.
virtual HRESULT OnNavigatePage();
Valor de retorno
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
[em] O ID do controle do botão de opção que o usuário clicou.
Valor de retorno
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
[em] Tempo em milissegundos desde que o CTaskDialog
foi criado ou o temporizador foi reiniciado.
Valor de retorno
A implementação padrão retorna S_OK.
Comentários
Substitua esse método em uma classe derivada para implementar o comportamento personalizado.
CTaskDialog::OnVerificationCheckboxClique
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
bVerificado
[em] TRUE indica que a caixa de seleção de verificação está marcada; FALSO indica que não é.
Valor de retorno
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 do 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
[em] A ID do controle de comando a ser atualizado.
bEnabled
[em] Um parâmetro booleano que indica se o controle de botão de comando especificado está habilitado ou desabilitado.
bRequiresElevation
[em] Um parâmetro booleano 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 à classe 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);
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 para serem habilitados e exigirem a elevação do UAC.
void SetCommonButtonOptions(
int nDisabledButtonMask,
int nElevationButtonMask = 0);
Parâmetros
nDisabledButtonMask
[em] Uma máscara para os botões comuns desativarem.
nElevationButtonMask
[em] Uma máscara para os botões comuns que requerem elevação.
Comentários
Você pode definir os botões comuns disponíveis para uma instância do CTaskDialog Class usando o construtor CTaskDialog::CTaskDialog e o método CTaskDialog::SetCommonButtons.
CTaskDialog::SetCommonButtonOptions
não suporta a 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 este CTaskDialog
, esse método lança uma exceção usando o ENSURE macro.
Esse método habilita qualquer botão que esteja disponível para o CTaskDialog
mas não esteja no nDisabledButtonMask, mesmo que tenha sido desabilitado anteriormente. Este 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
[em] Uma máscara dos botões para adicionar ao CTaskDialog
.
nDisabledButtonMask
[em] Uma máscara dos botões para desativar.
nElevationButtonMask
[em] Uma máscara dos botões que requerem elevação.
Comentários
Não é possível chamar esse método depois que a janela de exibição para esta instância da classe CTaskDialog
é criada. Se você fizer isso, esse método lançará uma exceção.
Os botões indicados por nButtonMask substituir quaisquer botões comuns adicionados anteriormente ao CTaskDialog
. Apenas os botões indicados no nButtonMask estão disponíveis.
Se nDisabledButtonMask ou nElevationButtonMask contiverem um botão que não esteja em nButtonMask, esse método lançará 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
[em] A cadeia de caracteres a ser exibida para o usuário.
Comentários
O conteúdo da classe CTaskDialog
é o texto que é 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
[em] O 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
é exibido pela primeira vez para o usuário.
Esse método lança uma exceção se ele não pode 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
[em] O 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 o CTaskDialog
é exibido pela primeira vez para o usuário.
Esse método lança uma exceção se não puder 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
[em] 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 lança uma exceção.
Se nWidth estiver definido como 0, esse método definirá a caixa de diálogo para 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 do CTaskDialog
.
void SetExpansionArea(
const CString& strExpandedInformation,
const CString& strCollapsedLabel = _T(""),
const CString& strExpandedLabel = _T(""));
Parâmetros
strExpandedInformation
[em] A cadeia de caracteres que o CTaskDialog
exibe no corpo principal da caixa de diálogo quando o usuário clica no botão de expansão.
strCollapsedLabel
[em] A cadeia de caracteres que o CTaskDialog
exibe ao lado do botão de expansão quando a área expandida é recolhida.
strExpandedLabel
[em] A cadeia de caracteres que o CTaskDialog
exibe ao lado do botão de expansão quando a área expandida é exibida.
Comentários
A área de expansão da classe CTaskDialog
permite que você forneça informações adicionais ao usuário. A área de expansão está na parte principal do CTaskDialog
, localizada imediatamente abaixo da cadeia de caracteres de título e conteúdo.
Quando o CTaskDialog
é exibido 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, o 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
[em] O novo ícone do CTaskDialog
.
lpszFooterIcon
[em] O novo ícone do CTaskDialog
.
Comentários
O ícone de rodapé é exibido na parte inferior do CTaskDialog Class. Pode ter texto de rodapé associado. Você pode alterar o texto do rodapé com CTaskDialog::SetFooterText.
Esse método lança uma exceção com o ENSURE macro se o CTaskDialog
for exibido ou o parâmetro de entrada for NULL.
Um CTaskDialog
só pode aceitar um HICON
ou LPCWSTR
como ícone de rodapé. Isso é configurado definindo a opção TDF_USE_HICON_FOOTER no construtor ou CTaskDialog::SetOptions. Por padrão, o CTaskDialog
é configurado para usar 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
[em] 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
[em] O novo ícone.
lpszMainIcon
[em] O novo ícone.
Comentários
Esse método lança uma exceção com o ENSURE macro se o CTaskDialog
for exibido ou o parâmetro de entrada for NULL.
Um CTaskDialog
só pode aceitar um HICON
ou LPCWSTR
como ícone principal. Você pode configurar isso definindo a opção TDF_USE_HICON_MAIN no construtor ou no CTaskDialog::SetOptions método. Por padrão, o 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
strInstruções
[em] A nova instrução principal.
Comentários
A instrução principal da classe CTaskDialog
é o 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
[em] O conjunto de bandeiras a serem usadas para o CTaskDialog
.
Comentários
Este 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.
Designação | Descrição |
---|---|
TDF_ENABLE_HYPERLINKS | Habilita hiperlinks no CTaskDialog . |
TDF_USE_HICON_MAIN | Configura o CTaskDialog para usar um HICON para o ícone principal. A alternativa é usar um LPCWSTR . |
TDF_USE_HICON_FOOTER | Configura o CTaskDialog para usar um HICON para o ícone de rodapé. A alternativa é usar um LPCWSTR . |
TDF_ALLOW_DIALOG_CANCELLATION | Permite que o usuário feche o CTaskDialog usando o teclado ou 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 o CTaskDialog para usar controles de botão de comando. |
TDF_USE_COMMAND_LINKS_NO_ICON | Configura o CTaskDialog para usar controles de botão de comando 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á atualmente expandida. |
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á marcada no momento. |
TDF_SHOW_PROGRESS_BAR | Configura o CTaskDialog para exibir uma barra de progresso. |
TDF_SHOW_MARQUEE_PROGRESS_BAR | Configura a barra de progresso como uma barra de progresso de letreiro. Se você habilitar essa opção, deverá definir TDF_SHOW_PROGRESS_BAR para ter o comportamento esperado. |
TDF_CALLBACK_TIMER | Indica que o intervalo de retorno de chamada CTaskDialog está definido como aproximadamente 200 milissegundos. |
TDF_POSITION_RELATIVE_TO_WINDOW | Configura o CTaskDialog a ser centralizado em relação à janela pai. Se esse sinalizador não estiver habilitado, o CTaskDialog será centralizado em relação ao monitor. |
TDF_RTL_LAYOUT | Configura o CTaskDialog para um layout de leitura da direita para a esquerda. |
TDF_NO_DEFAULT_RADIO_BUTTON | Indica que nenhum botão de opção está selecionado quando o CTaskDialog é exibido. |
TDF_CAN_BE_MINIMIZED | Permite ao usuário minimizar o CTaskDialog . Para suportar esta opção, o CTaskDialog não pode ser modal. MFC não suporta esta opção porque MFC não suporta um CTaskDialog sem modo. |
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 letreiro para o CTaskDialog
e a adiciona à caixa de diálogo.
void SetProgressBarMarquee(
BOOL bEnabled = TRUE,
int nMarqueeSpeed = 0);
Parâmetros
bEnabled
[em] TRUE para ativar a barra de seleção; FALSE para desativar a barra de seleção e removê-la do CTaskDialog
.
nMarqueeSpeed
[em] Um inteiro que indica a velocidade da barra de seleção.
Comentários
A barra de seleção aparece abaixo do texto principal da classe CTaskDialog
.
Use nMarqueeSpeed para definir a velocidade da barra de seleção; valores maiores indicam uma velocidade mais lenta. Um valor de 0 para nMarqueeSpeed faz com que a barra de letreiro se mova na velocidade padrão para Windows.
Esse método lança uma exceção com o ENSURE macro 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
[em] A posição da barra de progresso.
Comentários
Esse método lança uma exceção com o ENSURE macro se nProgressPos não estiver no intervalo de barras de progresso. Você pode alterar o intervalo da barra 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
[em] O limite inferior da barra de progresso.
nRangeMax
[em] 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á a meio caminho 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 estar habilitada. Este 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 do CTaskDialog Class.
Este método lança uma exceção com o ENSURE macro se nRangeMin não for inferior a nRangeMax. Esse método também lança 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-a no CTaskDialog
.
void SetProgressBarState(int nState = PBST_NORMAL);
Parâmetros
nState
[em] O estado da barra de progresso. Consulte a seção Comentários para obter os valores possíveis.
Comentários
Esse método lança uma exceção com o ENSURE macro se o CTaskDialog
já estiver exibido e tiver uma barra de progresso de marca de seleção.
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.
Designação | Descrição |
---|---|
PBST_NORMAL | Após o preenchimento da barra de progresso, o CTaskDialog não altera a cor da barra. Por padrão, a cor normal é verde. |
PBST_ERROR | Após o preenchimento da barra de progresso, o CTaskDialog altera a cor da barra para a cor de erro. Por padrão, isso é vermelho. |
PBST_PAUSED | Após o preenchimento da barra de progresso, o CTaskDialog altera a cor da barra 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
Ativa ou desativa um botão de opção.
void SetRadioButtonOptions(
int nRadioButtonID,
BOOL bEnabled);
Parâmetros
nRadioButtonID
[em] A ID do controle de botão de opção.
bEnabled
[em] TRUE para ativar o botão de opção; FALSE para desativar o botão de opção.
Comentários
Esse método lança uma exceção com o ENSURE macro 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 verificado da caixa de seleção de verificação.
void SetVerificationCheckbox(BOOL bChecked);
Parâmetros
bVerificado
[em] TRUE para ter a caixa de seleção de verificação marcada quando o CTaskDialog
for exibido; FALSO para que a caixa de seleção de verificação seja desmarcada quando o CTaskDialog
for exibido.
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
[em] O texto que esse método exibe ao lado da caixa de seleção de verificação.
Comentários
Esse método lança uma exceção com o ENSURE macro se essa instância da classe CTaskDialog
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
[em] 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
[em] A cadeia de caracteres a ser usada para o conteúdo do CTaskDialog
.
strMainInstruction
[em] A principal instrução do CTaskDialog
.
strTitle
[em] O título do CTaskDialog
.
nIDCommandControlsFirst
[em] A ID da cadeia de caracteres do primeiro comando.
nIDCommandControlsÚltima
[em] A ID da cadeia de caracteres do último comando.
nCommonButtons
[em] Uma máscara dos botões para adicionar ao CTaskDialog
.
nTaskDialogOptions
[em] O conjunto de opções a utilizar para o CTaskDialog
.
strFooter
[em] A cadeia de caracteres a ser usada como rodapé.
Valor de retorno
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 classe CTaskDialog
sem criar explicitamente um objeto CTaskDialog
em seu código. Como não há nenhum objeto CTaskDialog
, você não pode chamar nenhum outro método do CTaskDialog
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 seu 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.
O CTaskDialog
fecha quando o usuário seleciona um botão comum, um controle de link de comando ou fecha o CTaskDialog
. O valor de retorno é 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 do Windows.
friend:
HRESULT TaskDialogCallback(
HWND hWnd,
UINT uNotification,
WPARAM wParam,
LPARAM lParam,
LONG_PTR dwRefData);
Parâmetros
hwnd
[em] Uma alça para a estrutura m_hWnd
para o CTaskDialog
.
uNotification
[em] O código de notificação que especifica a mensagem gerada.
wParam
[em] Mais informações sobre a mensagem.
lParam
[em] Mais informações sobre a mensagem.
dwRefData
[em] Um ponteiro para o objeto CTaskDialog
ao qual a mensagem de retorno de chamada se aplica.
Valor de retorno
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 padrão do TaskDialogCallback
manipula a mensagem específica e, em seguida, chama o método On apropriado do CTaskDialog Class. 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 um ou ambos os valores estejam vazios. A tabela a seguir lista as notificações padrão suportadas 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 | valor de wParam | lParam Valor |
---|---|---|
TDN_CREATED | Não utilizado. | Não utilizado. |
TDN_NAVIGATED | Não utilizado. | Não utilizado. |
TDN_BUTTON_CLICKED | O ID de controle do botão de comando. | Não utilizado. |
TDN_HYPERLINK_CLICKED | Não utilizado. | Um LPCWSTR estrutura que contém o link. |
TDN_TIMER | Tempo em milissegundos desde que o CTaskDialog foi criado ou o temporizador foi reiniciado. |
Não utilizado. |
TDN_DESTROYED | Não utilizado. | Não utilizado. |
TDN_RADIO_BUTTON_CLICKED | O ID do botão de opção. | Não utilizado. |
TDN_DIALOG_CONSTRUCTED | Não utilizado. | Não utilizado. |
TDN_VERIFICATION_CLICKED | 1 se a caixa de seleção estiver marcada, 0 se não estiver. | Não utilizado. |
TDN_HELP | Não utilizado. | Não utilizado. |
TDN_EXPANDO_BUTTON_CLICKED | 0 se a área de expansão estiver colapsada; diferente de zero se o texto de expansão for exibido. | Não utilizado. |
Ver também
Aulas
CObject Classe
Gráfico de Hierarquia
Passo a passo: Adicionando um CTaskDialog a um aplicativo