网站首页  词典首页

请输入您要查询的函数:

 

术语 taskdialog
释义 TaskDialog
语法:
HRESULT TaskDialog( HWND hWndParent,
HINSTANCE hInstance,
PCWSTR pszWindowTitle,
PCWSTR pszMainInstruction,
PCWSTR pszContent,
TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons,
PCWSTR pszIcon,
int *pnButton
);
TaskDialog功能
该TaskDialog函数创建,显示和经营任务对话框。任务对话框包含应用程序定义的消息和标题的文本,图标和任何预定义的按键组合。此函数不支持注册一个回调函数接收通知。
参数
hWndParent
[in]句柄对话框的所有者窗口的任务要创建的。如果该参数为NULL,任务对话框没有所有者窗口。
hInstance
[in]句柄模块包含的图标资源的pszIcon成员查明,该字符串的pszWindowTitle和pszMainInstruction成员确定的资源。如果该参数为NULL,pszIcon不能是NULL,但必须指向一个空结束,Unicode字符串,其中包含一个系统资源的标识符,例如,TD_ERROR_ICON。如果该参数为NULL,pszWindowTitle和pszMainInstruction参数也必须指向空终止,Unicode字符串,包含系统资源标识符。
pszWindowTitle
[in]指向字符串用于任务对话框的标题。此参数是一个空终止,Unicode字符串,其中包含文字,或整数资源标识符通过MAKEINTRESOURCE宏通过。如果该参数为NULL,可执行程序的文件名被使用。
pszMainInstruction
[in]指向字符串用于主要指令。此参数是一个空终止,Unicode字符串,其中包含文字,或整数资源标识符通过MAKEINTRESOURCE宏通过。如果该参数为NULL,可执行程序的文件名被使用。
pszContent
[in]为指针,以低于其他文本的主要指令出现使用一个字符串,在一个较小的字体。此参数是一个空终止,Unicode字符串,其中包含文字,或整数资源标识符通过MAKEINTRESOURCE宏通过。可以为NULL,如果没有额外的文本通缉。
dwCommonButtons
[in]指定推动在对话框中显示的按钮。此参数可以是一个标志,从以下组的组合。
注意如果没有指定按钮,对话框将包含在默认情况下确定按钮。
TDCBF_OK_BUTTON
任务对话框包含按钮:确定。
TDCBF_YES_BUTTON
任务对话框包含按钮:是的。
TDCBF_NO_BUTTON
任务对话框包含按钮:第
TDCBF_CANCEL_BUTTON
任务对话框包含按钮:取消。这个按钮必须指定对话框的响应典型取消行动(ALT键- F4和逃逸)。
TDCBF_RETRY_BUTTON
任务对话框包含按钮:重试。
TDCBF_CLOSE_BUTTON
任务对话框包含按钮:关闭。
pszIcon
[in]指向一个字符串标识图标显示在任务对话框。此参数必须是整数资源标识符传递给MAKEINTRESOURCE宏或以下预定义值之一。如果该参数是NULL,没有图标将被显示。如果HINSTANCE参数是无效的预定义值之一是不使用,无图标将显示。
TD_ERROR_ICON
阿停止信号图标在任务对话框。
TD_WARNING_ICON
感叹号点图标将出现在对话框中。
TD_INFORMATION_ICON
一个图标的圆圈中的一个小写字母i组成的出现在任务对话框。
pnButton
[out]
当此函数返回时,它包含一个指向一个整数位置,收到下列值之一:
ValueDescription
0Function调用失败。请参阅更多信息返回值。
IDCANCELCancel按钮被选中之后,Alt - F 4键被按下,或逃走时被压在用户的关闭窗口按钮按下。
IDNONo按钮被选中。
IDOKOK按钮被选中。
IDRETRYRetry按钮被选中。
IDYESYes按钮被选中。
如果该值为NULL,没有返回值。
返回值
返回下列值之一。
S_OKThe操作成功完成。
E_OUTOFMEMORYThere足够的内存来完成此操作。
E_INVALIDARGOne或多个参数无效。
E_FAILThe操作失败。
备注
当您使用任务对话框显示系统内存不足,字符串指向的pszMainInstruction和pszWindowTitle参数不应该试图以来所加载资源从资源文件可能会失败。
如果您创建一个任务对话框时出现一个对话框,目前,使用句柄作为hWndParent参数对话框。在hWndParent参数不能确定,如在一个对话框控件一个子窗口。
使用此函数来创建一个文本和按钮,当一个简单的对话框MessageBox是不够的。为了实现更多的功能,使用TaskDialogIndirect。
下面的示例代码,包括作为一个更大的计划的一部分,显示了如何创建一个任务对话框和捕获输入。

int nButtonPressed = 0;
TaskDialog(NULL, hInst,
MAKEINTRESOURCE(IDS_APPLICATION_TITLE),
MAKEINTRESOURCE(IDS_DOSOMETHING),
MAKEINTRESOURCE(IDS_SOMECONTENT),
TDCBF_OK_BUTTON | TDCBF_CANCEL_BUTTON,
TD_WARNING_ICON,
&nButtonPressed);
if (IDOK == nButtonPressed)
{
// OK button pressed
}
else if (IDCANCEL == nButtonPressed)
{
// Cancel pressed
}
函数信息
最低DLL版本 comctl32.dll第6版
在commctrl.h HeaderDeclared,包括commctrl.h
import librarycomctl32.lib
最低支持操作系统 Vista
参见
对话框
==英文原文==TaskDialog Function
The TaskDialog function creates, displays, and operates a task dialog. The task dialog contains application-defined message text and title, icons, and any combination of predefined push buttons. This function does not support the registration of a callback function to receive notifications.
Syntax
HRESULT TaskDialog( HWND hWndParent,
HINSTANCE hInstance,
PCWSTR pszWindowTitle,
PCWSTR pszMainInstruction,
PCWSTR pszContent,
TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons,
PCWSTR pszIcon,
int *pnButton
);
Parameters
hWndParent
[in] Handle to the owner window of the task dialog to be created. If this parameter is NULL, the task dialog has no owner window.
hInstance
[in] Handle to the module that contains the icon resource identified by the pszIcon member, and the string resources identified by the pszWindowTitle and pszMainInstruction members. If this parameter is NULL, pszIcon must not be NULL, but must point to a null-terminated, Unicode string that contains a system resource identifier, for example, TD_ERROR_ICON. If this parameter is NULL, the pszWindowTitle and pszMainInstruction parameters must also point to null-terminated, Unicode strings that contain system resource identifiers.
pszWindowTitle
[in] Pointer to the string to be used for the task dialog title. This parameter is a null-terminated, Unicode string that contains either text, or an integer resource identifier passed through the MAKEINTRESOURCE macro. If this parameter is NULL, the filename of the executable program is used.
pszMainInstruction
[in] Pointer to the string to be used for the main instruction. This parameter is a null-terminated, Unicode string that contains either text, or an integer resource identifier passed through the MAKEINTRESOURCE macro. If this parameter is NULL, the filename of the executable program is used.
pszContent
[in] Pointer to a string used for additional text that appears below the main instruction, in a smaller font. This parameter is a null-terminated, Unicode string that contains either text, or an integer resource identifier passed through the MAKEINTRESOURCE macro. Can be NULL if no additional text is wanted.
dwCommonButtons
[in] Specifies the push buttons displayed in the dialog box. This parameter may be a combination of flags from the following group.
Note If no buttons are specified, the dialog box will contain the OK button by default.
TDCBF_OK_BUTTON
The task dialog contains the push button: OK.
TDCBF_YES_BUTTON
The task dialog contains the push button: Yes.
TDCBF_NO_BUTTON
The task dialog contains the push button: No.
TDCBF_CANCEL_BUTTON
The task dialog contains the push button: Cancel. This button must be specified for the dialog box to respond to typical cancel actions (Alt-F4 and Escape).
TDCBF_RETRY_BUTTON
The task dialog contains the push button: Retry.
TDCBF_CLOSE_BUTTON
The task dialog contains the push button: Close.
pszIcon
[in] Pointer to a string that identifies the icon to display in the task dialog. This parameter must be an integer resource identifier passed to the MAKEINTRESOURCE macro or one of the following predefined values. If this parameter is NULL, no icon will be displayed. If the hInstance parameter is null and one of the predefined values is not used, no icon will be displayed.
TD_ERROR_ICON
A stop-sign icon appears in the task dialog.
TD_WARNING_ICON
An exclamation-point icon appears in the dialog box.
TD_INFORMATION_ICON
An icon consisting of a lowercase letter i in a circle appears in the task dialog.
pnButton
[out]
When this function returns, contains a pointer to an integer location that receives 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 value is NULL, no value is returned.
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 pszMainInstruction and pszWindowTitle parameters 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.
Use this function to create a dialog with text and buttons, when a simple MessageBox is not adequate. To achieve more functionality, use TaskDialogIndirect .
The following example code, to be included as part of a larger program, shows how to create a task dialog and capture input.

int nButtonPressed = 0;
TaskDialog(NULL, hInst,
MAKEINTRESOURCE(IDS_APPLICATION_TITLE),
MAKEINTRESOURCE(IDS_DOSOMETHING),
MAKEINTRESOURCE(IDS_SOMECONTENT),
TDCBF_OK_BUTTON | TDCBF_CANCEL_BUTTON,
TD_WARNING_ICON,
&nButtonPressed);
if (IDOK == nButtonPressed)
{
// OK button pressed
}
else if (IDCANCEL == nButtonPressed)
{
// Cancel pressed
}
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
==原始网址==http://msdn.microsoft.com/en-us/library/bb760540(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:20:18