![]() |
CXTPTabClientWnd - How to tell if ..? |
Post Reply
|
| Author | |
Hazelnut
Groupie
Joined: 22 July 2005 Location: United States Status: Offline Points: 18 |
Post Options
Thanks(0)
Quote Reply
Topic: CXTPTabClientWnd - How to tell if ..?Posted: 15 August 2005 at 6:15pm |
|
Hi All, How can you tell when a tab on a CXTPTabClientWnd has been selected? In other words, I need to find the active frame based on which tab is selected WHEN the tab is changed but NOT when I manually check for it. I guess I want to know if there is a way to get notified when a tab is selected. The only message I see from the control is WM_XTP_PRETRANSLATEMOUSEMSG but that doesn't notify me if a tab is changed. Thanks! |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 16 August 2005 at 2:36am |
|
I think you don't need "tab selected" event because user can press Ctrl+Tab to change active MDI instead of using mouse.
You need WM_MDIACTIVATE event: 1. Override CXTPTabClientWnd, add message map 2. add ON_MESSAGE(WM_MDIACTIVATE, OnMDIActivate) 3. LRESULT CMyTabClientWnd::OnMDIActivate(WPARAM wParam, LPARAM lParam) { // do stuff. return CXTPTabClientWnd::OnMDIActivate(wParam, lParam); }
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Hazelnut
Groupie
Joined: 22 July 2005 Location: United States Status: Offline Points: 18 |
Post Options
Thanks(0)
Quote Reply
Posted: 16 August 2005 at 10:46am |
|
Thanks again Oleg, worked like a charm! class CMyTabClientWnd : public CXTPTabClientWnd{ public :CMyTabClientWnd() {} virtual ~CMyTabClientWnd() {} //{{AFX_VIRTUAL(CMyTabClientWnd) //}}AFX_VIRTUAL protected ://{{AFX_MSG(CMyTabClientWnd) afx_msg LRESULT CMyTabClientWnd::OnMDIActivate(WPARAM wParam, LPARAM lParam); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; /// CPP... BEGIN_MESSAGE_MAP (CMyTabClientWnd, CXTPTabClientWnd)//{{AFX_MSG_MAP(CMyTabClientWnd) ON_MESSAGE(WM_MDIACTIVATE, OnMDIActivate) //}}AFX_MSG_MAP END_MESSAGE_MAP() LRESULT CMyTabClientWnd::OnMDIActivate(WPARAM wParam, LPARAM lParam){ TRACE("Tab Activated\n"); return CXTPTabClientWnd::OnMDIActivate(wParam, lParam); } Edited by Hazelnut |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 17 August 2005 at 7:40am |
|
Glad to help :)
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |