文件名称:feimotaiduihuak
- 所属分类:
- 对话框与窗口
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2013-05-11
- 文件大小:
- 46kb
- 下载次数:
- 0次
- 提 供 者:
- wojiu*****
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
非模态对话框的创建比较复杂。下面介绍具体的方法:
首先,创建一个新的对话框资源,并新建一个类与之关联(用AppWizard);
其次,调用CDialog的默认构造函数来构造对话框对象(注意,创建的不是窗口),这一步在主框架窗口的构造函数中实现。
再次,调用CDialog::Create成员函数创建窗口,Create把资源ID作为参数,并且,在对话框窗口仍然在屏幕上显示时,就立刻返回控件。
最后,在关闭非模态对话框时,注意要调用DestroyWindow函数而不是CloseWindow。删除的只是对话框窗口,对话框对象并未删除,留待创建新的窗口。在程序退出时,再删除该对话框对象。这个过程中对话框与主窗口之间消息的传递必须由用户实现,自定义消息映射(在代码的第10步详细说明)。
在编程过程中必须准确了解何时构造对话框对象,何时创建对话框窗口,何时删除对话框。
-Non-modal dialog box to create more complicated. The following describes the specific methods:
First, create a new dialog resources, and create a new class associated with it (with AppWizard)
Second, call the CDialog the default constructor to construct the dialog object (note that not create the window), this step in the constructor of the main fr a me window.
Again, call CDialog :: Create member function to create a window, Create the resource ID as a parameter in the dialog window is still displayed on the screen, immediately return the control.
Finally, a non-modal dialog box is closed, pay attention to call the the DestroyWindow function instead of CloseWindow. Delete only the window of the dialog box, the dialog object is not deleted, left to create a new window. When the program exits, and then delete the dialog object. This process dialog box with the message transfer between the main window must be implemented by the user, the custom message map (Step 10 in the code for det
首先,创建一个新的对话框资源,并新建一个类与之关联(用AppWizard);
其次,调用CDialog的默认构造函数来构造对话框对象(注意,创建的不是窗口),这一步在主框架窗口的构造函数中实现。
再次,调用CDialog::Create成员函数创建窗口,Create把资源ID作为参数,并且,在对话框窗口仍然在屏幕上显示时,就立刻返回控件。
最后,在关闭非模态对话框时,注意要调用DestroyWindow函数而不是CloseWindow。删除的只是对话框窗口,对话框对象并未删除,留待创建新的窗口。在程序退出时,再删除该对话框对象。这个过程中对话框与主窗口之间消息的传递必须由用户实现,自定义消息映射(在代码的第10步详细说明)。
在编程过程中必须准确了解何时构造对话框对象,何时创建对话框窗口,何时删除对话框。
-Non-modal dialog box to create more complicated. The following describes the specific methods:
First, create a new dialog resources, and create a new class associated with it (with AppWizard)
Second, call the CDialog the default constructor to construct the dialog object (note that not create the window), this step in the constructor of the main fr a me window.
Again, call CDialog :: Create member function to create a window, Create the resource ID as a parameter in the dialog window is still displayed on the screen, immediately return the control.
Finally, a non-modal dialog box is closed, pay attention to call the the DestroyWindow function instead of CloseWindow. Delete only the window of the dialog box, the dialog object is not deleted, left to create a new window. When the program exits, and then delete the dialog object. This process dialog box with the message transfer between the main window must be implemented by the user, the custom message map (Step 10 in the code for det
(系统自动生成,下载前可以参看下载内容)
下载文件列表
源代码\MainFrm.cpp
......\MainFrm.h
......\ModelessDialog.cpp
......\ModelessDialog.h
......\ReadMe.txt
......\Resource.h
......\ShowModelessDialog.aps
......\ShowModelessDialog.clw
......\ShowModelessDialog.cpp
......\ShowModelessDialog.dsp
......\ShowModelessDialog.dsw
......\ShowModelessDialog.h
......\ShowModelessDialog.ncb
......\ShowModelessDialog.opt
......\ShowModelessDialog.plg
......\ShowModelessDialog.rc
......\ShowModelessDialogDoc.cpp
......\ShowModelessDialogDoc.h
......\ShowModelessDialogView.cpp
......\ShowModelessDialogView.h
......\StdAfx.cpp
......\StdAfx.h
......\res\ShowModelessDialog.ico
......\...\ShowModelessDialog.rc2
......\...\ShowModelessDialogDoc.ico
......\...\Toolbar.bmp
......\res
源代码