wince VC++ 对话框打不开的问题(转)
来源:互联网 发布:人工智能电影剧情 编辑:程序博客网 时间:2024/04/30 09:20
原文出处: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
);
Thisfunction is defined as a macro and creates a modal dialog box from adialog box template in memory. The DialogBoxIndirect macro does notreturn control until the specified callback function terminates themodal dialog box by calling the EndDialog function.
4. int DialogBoxIndirectParam(
HINSTANCE hInstance,
LPCDLGTEMPLATE hDialogTemplate,
HWND hWndParent,
DLGPROC lpDialogFunc,
LPARAM dwInitParam
);
Thisfunction creates a modal dialog box from a dialog box template inmemory. Before displaying the dialog box, the function passes anapplication-defined value to the dialog box procedure as the lParamparameter of the WM_INITDIALOG message. An application can use thisvalue 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
);
Thisfunction creates a modeless dialog box from a dialog box templateresource. Before displaying the dialog box, it passes anapplication-defined value to the dialog box procedure as the lParamparameter of the WM_INITDIALOG message. An application can use thisvalue to initialize dialog box controls.
4. HWND CreateDialogIndirectParam(
HINSTANCE hInstance,
LPCDLGTEMPLATE lpTemplate,
HWND hWndParent,
DLGPROC lpDialogFunc,
LPARAM lParamInit
);
Thisfunction creates a modeless dialog box from a dialog box template inmemory. Before displaying the dialog box, the function passes anapplication-defined value to the dialog box procedure as the lParamparameter of the WM_INITDIALOG message. An application can use thisvalue to initialize dialog box controls.
若用到需要标签的对话框则需要用到属性表或者是TabControl 控件
我用TabControl 控件实现对话框中标签的功能。其中用到了TCITEM 结构体。
在dll程序中用DialogBox()函数可以调出对话框,标签可以正常显示,但是在exe 程序中就调不出对该对话框了,更怪的是将TabControl 空间去掉,就可以调出对话框了。不知是什么原因?
经过一段时间的查找。原来在Exe程序中,需在调出对话框之前加上InitCommonControls();
void InitCommonControls(void);
Thisfunction registers and initializes the common control window classes.This function is obsolete. New applications should use theInitCommonControlsEx function.
终于可以打开带书签的对话框了。
Best Regards To All!
- wince VC++ 对话框打不开的问题(转)
- wince VC++ 对话框打不开的问题
- VC++对话框的KeyDown问题
- wince VC++ Common dialog box 打不开的问题
- WinCE中非模态对话框不能关闭的问题
- VC 对话框背景图刷新问题
- VC 对话框程序隐藏问题
- VC对话框焦点转换问题
- VC对话框焦点转换问题
- VC对话框焦点转换问题
- VC对话框运行后不能改变大小的问题
- VC多对话框界面程序,界面之间的切换问题
- VC++6.0 MFC对话框操作MySQL数据库的各种问题
- [转]wince的一些小问题集合
- 求助?WinCE的问题
- wince触摸屏的问题
- wince网络通讯的问题
- WinCE 的线程问题
- 国债净价交易
- SendKeys 语句
- 自定义FileDialog的外观
- 产品经理进行向上沟通的6点注意事项
- Flash P2P 通信技巧(AS-Java-AS)
- wince VC++ 对话框打不开的问题(转)
- 史上第一个Flash P2P源代码来啦!
- [转]JAVA集合框架简介
- 产品经理应该向唐骏学习人情练达
- VC中读写ini文件(转)
- 英语六级
- [转]Java集合框架使用总结
- 产品经理究竟做什么——6个关键职责
- 关于fltk::ShareImage::get()