从级联中排除某些 MDI 子窗口

发布于 2024-12-20 04:38:26 字数 285 浏览 5 评论 0原文

我编写了一个包含许多子表单的 MDI 应用程序,每个子表单都不同。假设用户创建了三个子窗体:第一个窗体的左上角位于屏幕坐标 0,0 处;第一个窗体的左上角位于屏幕坐标 0,0 处;第一个窗体的左上角位于屏幕坐标 0,0 处;第二个表单已被拖动到屏幕的右侧(坐标 100, 300),第三个表单出现在坐标 20,20 处。如果我使用主窗体的级联命令,那么第二个窗体将移动到10,10。

我希望第二个表格保持在原来的位置,并使第三个表格移动到 10, 10 (即级联顺序的第二位)。有没有办法从主窗体的“级联”命令中排除特定的 MDI 子窗体?

I have written an MDI app with many child forms, each different. Let's say that the user has created three child forms: the first form has its top left hand corner at screen coordinates 0,0; a second form has been dragged to the right hand side of the screen (coordinates 100, 300) and the third form appears at coordinates 20,20. If I use the main form's cascade command, then the second form will move to 10,10.

I would like the second form to stay where it is and get the third form to move to 10, 10 (ie second place of cascading order). Is there any way of excluding specific MDI child forms from the main form's 'Cascade' command?

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

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

发布评论

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

评论(1

弱骨蛰伏 2024-12-27 04:38:26

无法影响通过发送 WM_MDICASCADE 消息发送到 MDI 容器窗口, ClientHandle

现在,看看WM_MDICASCADE,它有一个选项可以跳过级联中禁用的 MDI 子项。因此,您可以禁用某些子窗口,自己发送 WM_MDICASCADE 消息,然后重新启用子窗口。我没有尝试这样做,但在我看来它很可能会起作用。

您的另一个选择是实现您自己的 MDI 子定位方法。这实际上是比较容易做到的。我建议您查阅 Wine 项目的源代码以了解如何执行此操作。关键文件是 user32 DLL 中的 mdi.c

There is no way to influence the behaviour of the Cascade method which is implemented by sending a WM_MDICASCADE message to the MDI container window, ClientHandle.

Now, looking at WM_MDICASCADE it has an option to skip disabled MDI children from cascading. So you could disable certain child windows, send a WM_MDICASCADE message yourself and then re-enable the child windows. I've not attempted to do this but it seems very likely to me that it would work.

Your other option is to implement your own MDI child positioning method. This is actually relatively easy to do. I would suggest that you consult the source code for the Wine project to get an idea how to do this. The key file is mdi.c in the user32 DLL.

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