将 UI 插入另一个 MFC 对话框

发布于 2024-11-10 02:49:37 字数 244 浏览 2 评论 0原文

我有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

ˉ厌 2024-11-17 02:49:37

我有一些具有此功能的应用程序,通常带有选项卡控件来在窗口之间切换。

首先,我在容器窗口中设置一个框架,对用户来说是不可见的。该框架只是对话框窗口所在位置的占位符。

然后,我将对话框窗口的实例创建为容器类中的全局变量,将对话框窗口创建为无模式窗口(使用 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(), not DoModal()), move the window to the same RECT of the frame control, and call ShowWindow() to show the window.

誰認得朕 2024-11-17 02:49:37

我是否正确理解您,您不希望对话框显示为对话框,而是显示为另一个窗口的内容或窗格?

换句话说,您想要摆脱对话框的标题栏并将对话框的内容嵌入到另一个窗口中,对吗?

这是可能的。您需要创建没有标题栏的对话框(更改窗口样式),并确保将对话框的窗口创建为您希望内容所在的窗口的子窗口。我可以进一步解释这一点,但我首先想知道我是否正确理解了你。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文