将 UI 插入另一个 MFC 对话框
我有一个 MFC 应用程序 (exe),其主 UI 中包含两个窗格。该应用程序加载另一个也包含一个对话框的 DLL。如何以编程方式将定义的对话框放入 DLL 中,并将其放入 MFC 应用程序的窗格中?问题不在于如何以编程方式从 DLL 中检索对话框,而是如何将此对话框放在属于应用程序的一个 UI 窗格的“顶部”(内部)?
我的目标是使用从 dll 检索的对话框自定义应用程序的 UI,并给用户一种感觉,这些对话框都属于一个应用程序 UI。感谢您的任何提示。
I have one MFC application (exe) that contains two panes in its main UI. This application loads another DLL that also contains one dialog. How can I programatically place a Dialog defined into the DLL, and put it into (within) the pane of the MFC application? The question is not how to programatically retrieve the dialog from the DLL but how to put this dialog 'on the top' (within, inside) of one UI pane that belongs to the application?
My goal is to customize the UI of the application with dialog(s) retrieved from a dll and give the user the feeling that these dialogs all belong to one application UI. Thanks for any hint.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我有一些具有此功能的应用程序,通常带有选项卡控件来在窗口之间切换。
首先,我在容器窗口中设置一个框架,对用户来说是不可见的。该框架只是对话框窗口所在位置的占位符。
然后,我将对话框窗口的实例创建为容器类中的全局变量,将对话框窗口创建为无模式窗口(使用 Create(),而不是 DoModal()) >),将窗口移动到框架控件的同一个
RECT
处,并调用ShowWindow()
来显示窗口。I have some applications with this feature, often with a tab control to alternate between windows.
First I set a frame in the container window, invisible to the user. The frame is just a placeholder to where the dialog window will be.
Then I make an instance of the dialog window as a global variable in the container class, I create the dialog window as a modeless window (using
Create()
, notDoModal()
), move the window to the sameRECT
of the frame control, and callShowWindow()
to show the window.我是否正确理解您,您不希望对话框显示为对话框,而是显示为另一个窗口的内容或窗格?
换句话说,您想要摆脱对话框的标题栏并将对话框的内容嵌入到另一个窗口中,对吗?
这是可能的。您需要创建没有标题栏的对话框(更改窗口样式),并确保将对话框的窗口创建为您希望内容所在的窗口的子窗口。我可以进一步解释这一点,但我首先想知道我是否正确理解了你。
Am I understanding you correctly that you don't want the dialogs to appear as dialogs, but rather as content of another window, or as a pane?
In other words, you want to get rid of the dialog's title bar and embed the dialog's content into another window, is that right?
That is possible. You would need to create the dialog without the title bar (change the window style) and make sure that you create the dialog's window as a childwindow of the window where you want the content to go. I can explain this further but I first would like to know if I'm understanding you correctly.