910124-如何在用户在视图之间切换时实现? [英] 910124 - how to realize when user switches between views?

查看:87
本文介绍了910124-如何在用户在视图之间切换时实现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 在MDI应用程序中,当用户在视图之间切换时,必须进行某些更新.什么是实现此消息的最佳方式?
在我的应用程序中,文档只有一个视图,但是从逻辑上讲,我希望在文档之间切换时得到通知.
thx

解决方案

当窗口变为活动或非活动状态时,将发送WM_NCACTIVATE消息以更新标题栏.使用视图窗口,消息将发送到视图的父框架窗口(CMDIChildWnd派生类).

因此,您可以将此类处理程序添加到子框架类中.在处理程序中,您可以使用CFrameWnd成员函数GetActiveDocument()GetActiveView()将信息传递到文档和相关视图.


hi in an MDI application, when user switches between views something have to be updated. what''s the best message to handle for realizing when this happens?
in my application a document has only one view, but logically i want to get notified when switch is between documents.
thx

解决方案

When a window becomes active or inactive, a WM_NCACTIVATE message is send to update the title bar. With view windows, the message is send to the parent frame window of the view (a CMDIChildWnd derived class).

So you may add such handlers to your child frame classes. From the handler, you may use the CFrameWnd member functions GetActiveDocument() and GetActiveView() to pass information to your document and related view.


这篇关于910124-如何在用户在视图之间切换时实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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