网站首页  词典首页

请输入您要查询的函数:

 

术语 createdialog
释义 CreateDialog
语法:
HWND CreateDialog( HINSTANCE hInstance,
LPCTSTR lpTemplate,
HWND hWndParent,
DLGPROC lpDialogFunc
);
的createDialog功能
是的createDialog宏创建一个对话框,从一个无模式对话框模板资源。该宏使用的createDialog CreateDialogParam功能。
参数
hInstance
[in]句柄模块的可执行文件包含对话框模板。
lpTemplate
[in]指定对话框模板。此参数要么是一个空指针结尾的字符串,指定对话框的模板或一个整数值,指定对话框的资源标识符模板的名称。如果该参数指定了一个资源标识符,它的高位字必须为零,其低位字必须包含标识符。您可以使用MAKEINTRESOURCE宏来创建此值。
hWndParent
[in]的窗口句柄拥有该对话框。
lpDialogFunc
[in]指向对话框过程。欲了解更多有关该对话框过程的详细信息,请参阅DialogProc。
返回值
如果函数成功,返回值是句柄对话框。
如果函数失败,返回值为NULL。为了获得更多错误信息,调用GetLastError。
此功能通常无法为以下几个原因:
无效的参数值
系统类是登记由不同的模块
该WH_CBT钩子安装并返回一个失败代码
如果在对话框模板的控件之一是未注册,或其窗口的窗口过程失败WM_CREATE或WM_NCCREATE
备注
该函数使用的createDialog CreateWindowEx函数创建对话框。的createDialog然后发送一个WM_INITDIALOG消息(和一个WM_SETFONT消息,如果模板指定DS_SETFONT或DS_SHELLFONT样式)的对话框过程。函数显示对话框,如果模板指定WS_VISIBLE风格。最后的createDialog返回窗口句柄对话框。
之后的createDialog返回,应用程序显示的对话框(如果它尚未显示使用ShowWindow函数)。破坏应用程序通过使用DestroyWindow函数对话框。为了支持键盘导航和其他对话框功能,对话框的消息循环必须调用IsDialogMessage函数。
Windows 95/98/Me中:该系统可支持255个最大的对话框控件模板。放置在一个对话框,超过255个的控制,创建在WM_INITDIALOG消息处理程序的控制,而不是把他们的模板。
例如
有关示例,请参见创建无模式对话框。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为ANSI和Unicode版本。
参见
对话框概述,CreateDialogIndirect,CreateDialogIndirectParam,CreateDialogParam,CreateWindowEx,DestroyWindow,DialogBox,DialogProc,IsDialogMessage,ShowWindow,WM_INITDIALOG,WM_SETFONT
==英文原文==CreateDialog Function
The CreateDialog macro creates a modeless dialog box from a dialog box template resource. The CreateDialog macro uses the CreateDialogParam function.
Syntax
HWND CreateDialog( HINSTANCE hInstance,
LPCTSTR lpTemplate,
HWND hWndParent,
DLGPROC lpDialogFunc
);
Parameters
hInstance
[in] Handle to the module whose executable file contains the dialog box template.
lpTemplate
[in] Specifies the dialog box template. This parameter is either the pointer to a null-terminated character string that specifies the name of the dialog box template or an integer value that specifies the resource identifier of the dialog box template. If the parameter specifies a resource identifier, its high-order word must be zero and its low-order word must contain the identifier. You can use the MAKEINTRESOURCE macro to create this value.
hWndParent
[in] Handle to the window that owns the dialog box.
lpDialogFunc
[in] Pointer to the dialog box procedure. For more information about the dialog box procedure, see DialogProc .
Return Value
If the function succeeds, the return value is the handle to the dialog box.
If the function fails, the return value is NULL. To get extended error information, call GetLastError .
This function typically fails for one of the following reasons:
an invalid parameter value
the system class was registered by a different module
The WH_CBT hook is installed and returns a failure code
if one of the controls in the dialog template is not registered, or its window window procedure fails WM_CREATE or WM_NCCREATE
Remarks
The CreateDialog function uses the CreateWindowEx function to create the dialog box. CreateDialog then sends a WM_INITDIALOG message (and a WM_SETFONT message if the template specifies the DS_SETFONT or DS_SHELLFONT style) to the dialog box procedure. The function displays the dialog box if the template specifies the WS_VISIBLE style. Finally, CreateDialog returns the window handle to the dialog box.
After CreateDialog returns, the application displays the dialog box (if it is not already displayed) by using the ShowWindow function. The application destroys the dialog box by using the DestroyWindow function. To support keyboard navigation and other dialog box functionality, the message loop for the dialog box must call the IsDialogMessage function.
Windows 95/98/Me: The system can support a maximum of 255 controls per dialog box template. To place more than 255 controls in a dialog box, create the controls in the WM_INITDIALOG message handler rather than placing them in the template.
Example
For an example, see Creating a Modeless Dialog Box .
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
UnicodeImplemented as ANSI and Unicode versions.
See Also
Dialog Boxes Overview , CreateDialogIndirect , CreateDialogIndirectParam , CreateDialogParam , CreateWindowEx , DestroyWindow , DialogBox , DialogProc , IsDialogMessage , ShowWindow , WM_INITDIALOG , WM_SETFONT
==原始网址==http://msdn.microsoft.com/en-us/library/ms645434(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:25:24