![]() |
CXTPRibbonTab handle WM_LBUTTONDOWN...? |
Post Reply ![]() |
Author | |
iamthewind ![]() Newbie ![]() Joined: 11 September 2007 Location: China Status: Offline Points: 22 |
![]() ![]() ![]() ![]() ![]() Posted: 05 November 2007 at 2:48am |
hi, I'm using CXTPRibbonBar, and I want to handle WM_LBUTTONDOWN click on tab.I try to catch WM_XTP_PRETRANSLATEMOUSEMSG at MainFrm, but it doesn't work, I can't get any messages.
How do I handle Left mouse click on Tab?
Thanks
|
|
![]() |
|
Oleg ![]() Senior Member ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello,
You have override CXTPRibbonBar and catch its WM_LBUTTONDOWN message.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
iamthewind ![]() Newbie ![]() Joined: 11 September 2007 Location: China Status: Offline Points: 22 |
![]() ![]() ![]() ![]() ![]() |
I have orerrided CXTPRibbonBar and and catch its WM_LBUTTONDOWN message, but WM_LBUTTONDOWN can't deliver to my CCustomizedRibbonBar class. I wrote like this, please have a look.
Thanks
//////////////////////////////////////////////////
//.h
//////////////////////////////////////////////////
class CCustomizedRibbonBar : public CXTPRibbonBar
{ DECLARE_MESSAGE_MAP() public: afx_msg void OnLButtonDown(UINT nFlags, CPoint point); }; ////////////////////////////////////////////////// //.cpp
//////////////////////////////////////////////////
BEGIN_MESSAGE_MAP(CCustomizedRibbonBar, CXTPRibbonBar)
ON_WM_LBUTTONDOWN() END_MESSAGE_MAP() void CCustomizedRibbonBar::OnLButtonDown(UINT nFlags, CPoint point) //////////////////////////////////////////////////
//Mainfrm.cpp
////////////////////////////////////////////////// BOOL CMainFrame::CreateRibbonBar()
{ ...
m_pRibbonBar = (CCustomizedRibbonBar*)pCommandBars->Add(_T("TEST"), xtpBarTop, RUNTIME_CLASS(CCustomizedRibbonBar));
...
}
|
|
![]() |
|
iamthewind ![]() Newbie ![]() Joined: 11 September 2007 Location: China Status: Offline Points: 22 |
![]() ![]() ![]() ![]() ![]() |
I believe override CXTPRibbonBar but it never can catch its WM_LBUTTONDOWN message.
So I choose subclass m_pRibbonBar->m_hwnd, it work fine now.
just like the following code:
(WNDPROC)::SetWindowLong(m_pRibbonBar->m_hWnd, GWL_WNDPROC, (DWORD)LClickWndProc);
|
|
![]() |
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 |