在mfc MDI项目中,onfilenew恢复现有的全屏MDI子项。以任何方式禁用还原。 [英] In mfc MDI project the onfilenew restores the existing fullscreen MDI child. Any way to disable the restore.

查看:122
本文介绍了在mfc MDI项目中,onfilenew恢复现有的全屏MDI子项。以任何方式禁用还原。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我有一个MFC MDI项目,在开始时创建一个最大化的MDI子窗口。之后,用户可以创建更多MDI子项。据观察,当OnFileNew()创建更多的孩子(其中12个)时,现有的最大化MDI子项将被恢复,我们会在屏幕上看到恢复的mdi子窗口。

有没有办法停止恢复现有的最大化MDI子窗口。

我有截图显示问题。



谢谢和问候,
Rakesh



我尝试过:



我尝试在隐藏模式下创建新的子项(SW_HIDE)。它没有用。我尝试在mdi主框架客户区域外创建非常小的新孩子。

我尝试将现有窗口放在最上面

Dear All,
I have a MFC MDI project where in on start a maximised MDI child window is created. Later the user can create more MDI children. It is observed that when more children (12 of them) are created by OnFileNew() the existing maximized MDI child is restored and we see the restored mdi child window on screen.
Is there a way to stop the restoring of the existing maximized MDI child window.
I have got screenshot which shows the problem.

Thanks and Regards,
Rakesh

What I have tried:

I have tried creating the new children in hide mode (SW_HIDE). It didnt work. I tried creating the new children in very small size and outside the mdi main frame client area.
I have tried putting the existing window on top
(

pAnimView->SetWindowPos(&CWnd::wndTop, 0, 0, 0, 0,SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);



和然后调用OnFileNew();

没什么用。

)
and then making calls to OnFileNew();
Nothing worked.

推荐答案

你必须小心实现OnNewFile 命令处理程序。重新编号或重命名ID是弄乱消息处理的常见陷阱。



检查是否创建了子窗口对象而不是只能用实际对象重新运行命令。
You must carefully implement the OnNewFile command handler. Renumbering or renaming the IDs is a common trap for messing up the message handling.

Check that you create a new child window object and not only re-run the commands with the actual object.


这篇关于在mfc MDI项目中,onfilenew恢复现有的全屏MDI子项。以任何方式禁用还原。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆