网站首页  词典首页

请输入您要查询的函数:

 

术语 taskdialogindirect
释义 TaskDialogIndirect
语法:
HRESULT TaskDialogIndirect( const TASKDIALOGCONFIG *pTaskConfig,
int *pnButton,
int *pnRadioButton,
BOOL *pfVerificationFlagChecked
);
TaskDialogIndirect功能
该TaskDialogIndirect函数创建,显示和经营任务对话框。任务对话框包含应用程序定义的图标,邮件,标题,验证复选框,命令链接,按钮和单选按钮。这个功能可以注册一个回调函数来接收通知消息。
参数
pTaskConfig
[in]指向1 TASKDIALOGCONFIG结构,它包含用于显示任务对话框的信息。
pnButton
[out]
一个变量的地址接收之一:
一个在pTaskConfig参数pButtons成员中指定的按钮的ID
1以下值:
ValueDescription
0Function调用失败。请参阅更多信息返回值。
IDCANCELCancel按钮被选中之后,Alt - F 4键被按下,或逃走时被压在用户的关闭窗口按钮按下。
IDNONo按钮被选中。
IDOKOK按钮被选中。
IDRETRYRetry按钮被选中。
IDYESYes按钮被选中。
如果该参数是NULL,没有返回值。
pnRadioButton
[内]的一个变量,它收到在pTaskConfig参数pRadioButtons成员中指定一个按钮的ID地址。如果该参数是NULL,没有返回值。
pfVerificationFlagChecked
[out]
一个变量的地址接收下列值之一:
ValueDescription
TRUEThe验证复选框被选中时,对话框被驳回。
FALSEThe验证复选框未被选中对话框时,被驳回。
如果该参数为NULL,则验证复选框被禁用。
返回值
返回下列值之一。
S_OKThe操作成功完成。
E_OUTOFMEMORYThere足够的内存来完成此操作。
E_INVALIDARGOne或多个参数无效。
E_FAILThe操作失败。
备注
当您使用任务对话框显示系统内存不足,字符串指出的各种字符串和TASKDIALOGCONFIG结构图标的成员不应该试图以来所加载资源从资源文件可能会失败。
如果您创建一个任务对话框时出现一个对话框,目前,使用句柄作为hWndParent参数对话框。在hWndParent参数不能确定,如在一个对话框控件一个子窗口。
父窗口不应该隐藏或禁用此功能时调用。

int nButtonPressed = 0;
TASKDIALOGCONFIG config = {0};
const TASKDIALOG_BUTTON buttons[] = {
{ IDOK, L"Change password" }
};
config.cbSize = sizeof(config);
config.hInstance = hInst;
config.dwCommonButtons = TDCBF_CANCEL_BUTTON;
config.pszMainIcon = TD_WARNING_ICON;
config.pszMainInstruction = L"Change Password";
config.pszContent = L"Remember your changed password.";
config.pButtons = buttons;
config.cButtons = ARRAYSIZE(buttons);
TaskDialogIndirect(&config, &nButtonPressed, NULL, NULL);
switch (nButtonPressed)
{
case IDOK:
break; // the user pressed button 0 (change password).
case IDCANCEL:
break; // user cancelled the dialog
default:
break; // should never happen
}
功能信息
最低DLL版本 comctl32.dll第6版
在commctrl.h HeaderDeclared,包括commctrl.h
import librarycomctl32.lib
最低支持操作系统 Vista
参见
对话框,TaskDialog
==英文原文==TaskDialogIndirect Function
The TaskDialogIndirect function creates, displays, and operates a task dialog. The task dialog contains application-defined icons, messages, title, verification check box, command links, push buttons, and radio buttons. This function can register a callback function to receive notification messages.
Syntax
HRESULT TaskDialogIndirect( const TASKDIALOGCONFIG *pTaskConfig,
int *pnButton,
int *pnRadioButton,
BOOL *pfVerificationFlagChecked
);
Parameters
pTaskConfig
[in] Pointer to a TASKDIALOGCONFIG structure that contains information used to display the task dialog.
pnButton
[out]
Address of a variable that receives either:
one of the button IDs specified in the pButtons member of the pTaskConfig parameter
one of the following values:
ValueDescription
0Function call failed. Refer to return value for more information.
IDCANCELCancel button was selected, Alt-F4 was pressed, Escape was pressed or the user clicked on the close window button.
IDNONo button was selected.
IDOKOK button was selected.
IDRETRYRetry button was selected.
IDYESYes button was selected.
If this parameter is NULL, no value is returned.
pnRadioButton
[out] Address of a variable that receives one of the button IDs specified in the pRadioButtons member of the pTaskConfig parameter. If this parameter is NULL, no value is returned.
pfVerificationFlagChecked
[out]
Address of a variable that receives one of the following values:
ValueDescription
TRUEThe verification checkbox was checked when the dialog was dismissed.
FALSEThe verification checkbox was not checked when the dialog was dismissed.
If this parameter is NULL, the verification checkbox is disabled.
Return Value
Returns one of the following values.
S_OKThe operation completed successfully.
E_OUTOFMEMORYThere is insufficient memory to complete the operation.
E_INVALIDARGOne or more arguments are not valid.
E_FAILThe operation failed.
Remarks
When you use a task dialog box to indicate that the system is low on memory, the strings pointed to by the various string and icon members in the TASKDIALOGCONFIG structure should not be taken from a resource file since an attempt to load the resource may fail.
If you create a task dialog while a dialog box is present, use a handle to the dialog box as the hWndParent parameter. The hWndParent parameter should not identify a child window, such as a control in a dialog box.
The parent window should not be hidden or disabled when this function is called.

int nButtonPressed = 0;
TASKDIALOGCONFIG config = {0};
const TASKDIALOG_BUTTON buttons[] = {
{ IDOK, L"Change password" }
};
config.cbSize = sizeof(config);
config.hInstance = hInst;
config.dwCommonButtons = TDCBF_CANCEL_BUTTON;
config.pszMainIcon = TD_WARNING_ICON;
config.pszMainInstruction = L"Change Password";
config.pszContent = L"Remember your changed password.";
config.pButtons = buttons;
config.cButtons = ARRAYSIZE(buttons);
TaskDialogIndirect(&config, &nButtonPressed, NULL, NULL);
switch (nButtonPressed)
{
case IDOK:
break; // the user pressed button 0 (change password).
case IDCANCEL:
break; // user cancelled the dialog
default:
break; // should never happen
}
Function Information
Minimum DLL Versioncomctl32.dll version 6
HeaderDeclared in commctrl.h, include commctrl.h
Import librarycomctl32.lib
Minimum operating systemsWindows Vista
See Also
Dialog Boxes , TaskDialog
==原始网址==http://msdn.microsoft.com/en-us/library/bb760544(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:16:04