网站首页  词典首页

请输入您要查询的函数:

 

术语 createdialogindirect
释义 CreateDialogIndirect
语法:
HWND CreateDialogIndirect( HINSTANCE hInstance,
LPCDLGTEMPLATE lpTemplate,
HWND hWndParent,
DLGPROC lpDialogFunc
);
CreateDialogIndirect功能
在CreateDialogIndirect宏创建一个对话框,从一个无模式对话框模板在内存中。该CreateDialogIndirect宏使用CreateDialogIndirectParam功能。
参数
hInstance
[in]句柄模块创建对话框。
lpTemplate
[in]指向一个全局内存对象,包含一个模板,CreateDialogIndirect用来创建对话框。一个对话框模板包含一个标题,描述对话框后面跟着一个或多个额外的数据块来描述在对话框中的每个控件。该模板可使用的标准格式或扩展格式。
在一个标准模板,头是一个DLGTEMPLATE结构增加变长数组之后。为每个控件的数据包括额外变长数组奉行DLGITEMTEMPLATE结构。
在扩展模板对话框中,标头使用DLGTEMPLATEEX格式和控制的定义使用DLGITEMTEMPLATEEX格式。
经过CreateDialogIndirect回报,您可以免费的模板,而且只用于获取对话框启动。
hWndParent
[in]的窗口句柄拥有该对话框。
lpDialogFunc
[in]指向对话框过程。欲了解更多有关该对话框过程的详细信息,请参阅DialogProc。
返回值
如果函数成功,返回值是窗口句柄对话框。
如果函数失败,返回值为NULL。为了获得更多错误信息,调用GetLastError。
备注
该CreateDialogIndirect宏使用CreateWindowEx函数创建对话框。 CreateDialogIndirect然后发送WM_INITDIALOG消息的对话框过程。如果模板指定DS_SETFONT或DS_SHELLFONT风格,功能也发送WM_SETFONT消息对话框过程。函数显示对话框,如果模板指定WS_VISIBLE风格。最后,CreateDialogIndirect返回窗口句柄对话框。
之后CreateDialogIndirect返回,您可以使用ShowWindow函数来显示对话框(如果它尚未显示)。破坏对话框中,使用的DestroyWindow功能。为了支持键盘导航和其他对话框功能,对话框的消息循环必须调用IsDialogMessage函数。
在标准的对话框模板,DLGTEMPLATE结构和DLGITEMTEMPLATE结构必须在每一个双字节值边界对齐。建立数据数组遵循DLGITEMTEMPLATE结构也必须是一个DWORD对齐边界。所有其他变长数组模板中必须单词边界对齐。
在扩展对话框模板,DLGTEMPLATEEX页眉和DLGITEMTEMPLATEEX控制的定义必须在每一个双字节值边界对齐。建立数据数组,如果有的话遵循DLGITEMTEMPLATEEX结构也必须是一个DWORD对齐边界。所有其他变长数组模板中必须单词边界对齐。
在该对话框中的所有字符串模板,如对话框和按钮的名称,必须是Unicode字符串。要创建代码,两微软Windows 95/98和Windows NT/2000/XP,作品使用MultiByteToWideChar函数生成这些Unicode字符串。
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版本。
参见
对话框概览的createDialog,CreateDialogIndirectParam,CreateDialogParam,CreateWindowEx,DestroyWindow,DialogProc,DLGITEMTEMPLATE,DLGITEMTEMPLATEEX,DLGTEMPLATE,DLGTEMPLATEEX,IsDialogMessage,MultiByteToWideChar,ShowWindow,WM_INITDIALOG,WM_SETFONT
==英文原文==CreateDialogIndirect Function
The CreateDialogIndirect macro creates a modeless dialog box from a dialog box template in memory. The CreateDialogIndirect macro uses the CreateDialogIndirectParam function.
Syntax
HWND CreateDialogIndirect( HINSTANCE hInstance,
LPCDLGTEMPLATE lpTemplate,
HWND hWndParent,
DLGPROC lpDialogFunc
);
Parameters
hInstance
[in] Handle to the module that creates the dialog box.
lpTemplate
[in] Pointer to a global memory object containing a template that CreateDialogIndirect uses to create the dialog box. A dialog box template consists of a header that describes the dialog box, followed by one or more additional blocks of data that describe each of the controls in the dialog box. The template can use either the standard format or the extended format.
In a standard template, the header is a DLGTEMPLATE structure followed by additional variable-length arrays. The data for each control consists of a DLGITEMTEMPLATE structure followed by additional variable-length arrays.
In an extended dialog box template, the header uses the DLGTEMPLATEEX format and the control definitions use the DLGITEMTEMPLATEEX format.
After CreateDialogIndirect returns, you can free the template, which is only used to get the dialog box started.
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 window handle to the dialog box.
If the function fails, the return value is NULL. To get extended error information, call GetLastError .
Remarks
The CreateDialogIndirect macro uses the CreateWindowEx function to create the dialog box. CreateDialogIndirect then sends a WM_INITDIALOG message to the dialog box procedure. If the template specifies the DS_SETFONT or DS_SHELLFONT style, the function also sends a WM_SETFONT message to the dialog box procedure. The function displays the dialog box if the template specifies the WS_VISIBLE style. Finally, CreateDialogIndirect returns the window handle to the dialog box.
After CreateDialogIndirect returns, you can use the ShowWindow function to display the dialog box (if it is not already visible). To destroy the dialog box, use the DestroyWindow function. To support keyboard navigation and other dialog box functionality, the message loop for the dialog box must call the IsDialogMessage function.
In a standard dialog box template, the DLGTEMPLATE structure and each of the DLGITEMTEMPLATE structures must be aligned on DWORD boundaries. The creation data array that follows a DLGITEMTEMPLATE structure must also be aligned on a DWORD boundary. All of the other variable-length arrays in the template must be aligned on WORD boundaries.
In an extended dialog box template, the DLGTEMPLATEEX header and each of the DLGITEMTEMPLATEEX control definitions must be aligned on DWORD boundaries. The creation data array, if any, that follows a DLGITEMTEMPLATEEX structure must also be aligned on a DWORD boundary. All of the other variable-length arrays in the template must be aligned on WORD boundaries.
All character strings in the dialog box template, such as titles for the dialog box and buttons, must be Unicode strings. To create code that works on both Microsoft Windows 95/98/Me and Windows NT/2000/XP, use the MultiByteToWideChar function to generate these Unicode strings.
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.
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 , CreateDialog , CreateDialogIndirectParam , CreateDialogParam , CreateWindowEx , DestroyWindow , DialogProc , DLGITEMTEMPLATE , DLGITEMTEMPLATEEX , DLGTEMPLATE , DLGTEMPLATEEX , IsDialogMessage , MultiByteToWideChar , ShowWindow , WM_INITDIALOG , WM_SETFONT
==原始网址==http://msdn.microsoft.com/en-us/library/ms645436(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:26