910124-如何在用户在视图之间切换时实现? [英] 910124 - how to realize when user switches between views?
本文介绍了910124-如何在用户在视图之间切换时实现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的应用程序中,文档只有一个视图,但是从逻辑上讲,我希望在文档之间切换时得到通知.
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, aWM_NCACTIVATE
message is send to update the title bar. With view windows, the message is send to the parent frame window of the view (aCMDIChildWnd
derived class).
So you may add such handlers to your child frame classes. From the handler, you may use theCFrameWnd
member functionsGetActiveDocument()
andGetActiveView()
to pass information to your document and related view.
这篇关于910124-如何在用户在视图之间切换时实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文