如何在MDI选项卡式应用程序中捕获切换选项卡? [英] how to catch switching tabs in MDI tabbed application?

查看:122
本文介绍了如何在MDI选项卡式应用程序中捕获切换选项卡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

完美的例子是Microsoft自己的MDITabsDemo应用程序.
我想知道的是用户何时从一个选项卡切换到另一个选项卡.
谢谢.

The perfect example is Microsoft''s own MDITabsDemo app.
All I want to know when user switches from one tab to another.
Thanks.

推荐答案

WM_NCACTIVATE [ ^ ]看起来有可能.如果仍然找不到,请获取Spy ++的副本,该副本可以为您跟踪所有消息.
WM_NCACTIVATE[^] looks like a possibility. If you still cannot find out then get a copy of Spy++ which can trace all the messages for you.


我尝试了WM_NCACTIVATE,但有些失败.
我决定重写OnCmdMsg并最终抓住了它.消息ID为0x0363,大于0x0360 = WM_AFXFIRST.此消息分配给MFC.
OnCmdMsg收到大量点击(消息),我必须监视一个活动选项卡,如果它与上一个选项卡不同.
我一直希望对MFC内部有深入了解的人能够帮助我有效地处理此消息,尤其是nID和nCode的含义.
I tried WM_NCACTIVATE and some to no avail.
I decided to override OnCmdMsg and finally caught it. Message id is 0x0363 which is above 0x0360 = WM_AFXFIRST. This message is allocated to MFC.
OnCmdMsg gets an avalanche of hits (messages) and I have to monitor an active tab and if it differ from the last one.
I''ve been hoping somebody with an intimate knowledge of MFC internals helps me to process this message efficiently, and, particularly, the meaning of nID and nCode.


这篇关于如何在MDI选项卡式应用程序中捕获切换选项卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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