尝试将 MDI 子窗口提取到其 MDI 父窗口之外

发布于 2024-09-25 09:14:30 字数 411 浏览 1 评论 0原文

我已经能够使用以下代码将 mdichild 窗口重新设置为桌面的父级:

SetParent(hSeekedWindow,0);
SetWindowLong(hSeekedWindow,GWL_STYLE,WS_OVERLAPPED|WS_VISIBLE|WS_CAPTION|WS_MAXIMIZEBOX|    WS_MINIMIZEBOX|WS_THICKFRAME|WS_SIZEBOX);
SetWindowLong(hSeekedWindow,GWL_EXSTYLE,WS_EX_CLIENTEDGE);

但是,一旦我尝试调整前子窗口的大小,整个应用程序就会崩溃。我想这是因为 exchild 不再收到消息了。我的问题是:如果我以某种方式创建一个不可见的 mdichild 将其消息转发给 exchild,我是否能够完成这项工作?

I have been able to reparent an mdichild window to the desktop with the following code:

SetParent(hSeekedWindow,0);
SetWindowLong(hSeekedWindow,GWL_STYLE,WS_OVERLAPPED|WS_VISIBLE|WS_CAPTION|WS_MAXIMIZEBOX|    WS_MINIMIZEBOX|WS_THICKFRAME|WS_SIZEBOX);
SetWindowLong(hSeekedWindow,GWL_EXSTYLE,WS_EX_CLIENTEDGE);

However, as soon as i try to resize the ex-childwindow the whole app crashes. I suppose this is because the exchild is not getting its messages anymore. My question is this: would i be able to make this work if i somehow created an invisible mdichild that forwards its messages to exchild?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

流心雨 2024-10-02 09:14:30

是的,那不健康。按照与 Windows 窗体相同的方式进行操作,只需重新创建窗口,现在减去 WS_EX_MDICHILD 样式标志。毁掉旧的。是的,你会看到一点闪烁。只需为这个新窗口提供相同的窗口过程即可利用现有代码。

Yeah, that's not healthy. Do it the same way as Windows Forms does it, just re-create the window, now minus the WS_EX_MDICHILD style flag. Destroy the old one. Yes, you'll get a bit of flicker. Leverage your existing code simply by giving this new window the same window procedure.

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