原文出处:http://blog.csdn.net/saifeng/archive/2007/09/11/1781041.aspx
对话框有模式对话框和非模式对话框,一般情况下大家都会用到模式对话框
调用方法为:
一.有模式对话框:
1. int DialogBox(
HINSTANCE hInstance,
LPCTSTR lpTemplate,
HWND hWndParent,
DLGPROC lpDialogFunc
);
This function creates a modal dialog box from a dialog box template resource. DialogBox does not return control until the
specified callback function terminates the modal dialog box by calling the EndDialog function.
2. int DialogBoxParam(
HINSTANCE hInstance,
LPCTSTR lpTemplateName,
HWND hWndParent,
DLGPROC lpDialogFunc,
PARAM dwInitParam
);
This function creates a modal dialog box from a dialog box template resource. Before displaying the dialog box, the
function passes an application-defined value to the dialog box procedure as the lParam parameter of the WM_INITDIALOG
message. An application can use this value to initialize dialog box controls.
3. int DialogBoxIndirect(
HINSTANCE hInstance,
LPDLGTEMPLATE lpTemplate,
HWND hWndParent,
DLGPROC lpDialogFunc
);
This
function is defined as a macro and creates a modal dialog box from a
dialog box template in memory. The DialogBoxIndirect macro does not
return control until the specified callback function terminates the
modal dialog box by calling the EndDialog function.
4. int DialogBoxIndirectParam(
HINSTANCE hInstance,
LPCDLGTEMPLATE hDialogTemplate,
HWND hWndParent,
DLGPROC lpDialogFunc,
LPARAM dwInitParam
);
This
function creates a modal dialog box from a dialog box template in
memory. Before displaying the dialog box, the function passes an
application-defined value to the dialog box procedure as the lParam
parameter of the WM_INITDIALOG message. An application can use this
value to initialize dialog box controls.
二.无模式对话框
1. HWND CreateDialog(
HINSTANCE hInstance,
LPCTSTR lpTemplate,
HWND hWndParent,
DLGPROC lpDialogFunc
);
This function creates a modeless dialog box from a dialog box template resource.
2. HWND CreateDialogIndirect(
HINSTANCE hInstance,
LPCDLGTEMPLATE lpTemplate,
HWND hWndParent,
DLGPROC lpDialogFunc
);
This function creates a modeless dialog box from a dialog box template in memory.
3. HWND CreateDialogParam(
HINSTANCE hInstance,
LPCTSTR lpTemplateName,
HWND hWndParent,
DLGPROC lpDialogFunc,
LPARAM dwInitParam
);
This
function creates a modeless dialog box from a dialog box template
resource. Before displaying the dialog box, it passes an
application-defined value to the dialog box procedure as the lParam
parameter of the WM_INITDIALOG message. An application can use this
value to initialize dialog box controls.
4. HWND CreateDialogIndirectParam(
HINSTANCE hInstance,
LPCDLGTEMPLATE lpTemplate,
HWND hWndParent,
DLGPROC lpDialogFunc,
LPARAM lParamInit
);
This
function creates a modeless dialog box from a dialog box template in
memory. Before displaying the dialog box, the function passes an
application-defined value to the dialog box procedure as the lParam
parameter of the WM_INITDIALOG message. An application can use this
value to initialize dialog box controls.
若用到需要标签的对话框则需要用到属性表或者是TabControl 控件
我用TabControl 控件实现对话框中标签的功能。其中用到了TCITEM 结构体。
在dll程序中用DialogBox()函数可以调出对话框,标签可以正常显示,但是在exe 程序中就调不出对该对话框了,更怪的是将TabControl 空间去掉,就可以调出对话框了。不知是什么原因?
经过一段时间的查找。原来在Exe程序中,需在调出对话框之前加上InitCommonControls();
void InitCommonControls(void);
This
function registers and initializes the common control window classes.
This function is obsolete. New applications should use the
InitCommonControlsEx function.
终于可以打开带书签的对话框了。
Best Regards To All!
分享到:
相关推荐
WINCE下给对话框添加菜单, WINCE下给对话框添加菜单
我的项目工程 wince mfc 基于对话框
在wince中的EVC编程环境里,基于对话框添加菜单的例程源码,在EVC++ 4.0编译调试通过了的。
armmagic2410wince对话框控件代码
Wince 对话框控件 源程序 初学者很好的例子
本文档描述了怎么在基于WinCE的平台,在EVC4.0上制作对话框程序
wince5.0颜色选择对话框控件,源码有调试程序
vc++wince下操作数据库代码 vc++wince下操作数据库代码
wince5.0字体选择对话框控件,c#源码并且有调试程序
wince 6.0 gps vc++源码
详细的代码注释,wince系统下串口通信收发程序,实现串口调试助手功能,可通过设置嵌入式设备串口号及波特率等参数接收下位机发送数据以及给下位机发送数据指令,另增加wince下对话框背景图片的增加
1、因为正好需要做控件demo,另外自己开发wince项目时需要的打开文件对话框 系统无法满足要求,故这次自己定制了一款文件打开对话框(仿Windows), 这个demo也可用于wince开发项目中; 2、主界面有列表框联动...
请帮忙完成滚动功能,谢谢!
wince相关的发送短信,联系人拨打,直接拨打的VC++代码,可以直接使用
Wince5.0下的浏览器,编译过了。上网OK! Wince5.0下的浏览器,编译过了。上网OK! 环境是:EVC
关于嵌入式wince中的一个实验,sqlite,源码奉上,需要的文件无需下载,都有提供
在wince6.0系统里搜索蓝牙并链接 可以将打印信息发送到蓝牙设备上进行打印
wince5.0 下用C#写的蓝牙打印测试程序。程序使用MC3000手持和Zebra MZ220便携式打印机测试通过。 程序是建立serialport对象,指定com口连接打印机,界面上open打开蓝牙端口,close关闭蓝牙端口 打印时向蓝牙端口发送...
在windows mobile 5环境下建立menu的方法