Print Page | Close Window

CXTPRibbonTab handle WM_LBUTTONDOWN...?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=8659
Printed Date: 25 July 2025 at 9:47pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPRibbonTab handle WM_LBUTTONDOWN...?
Posted By: iamthewind
Subject: CXTPRibbonTab handle WM_LBUTTONDOWN...?
Date 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



Replies:
Posted By: Oleg
Date Posted: 05 November 2007 at 4:18am
Hello,
 
You have override CXTPRibbonBar and catch its WM_LBUTTONDOWN message.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: iamthewind
Date Posted: 16 November 2007 at 2:55am
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)
{
 CXTPRibbonBar::OnLButtonDown(nFlags, point);
}

//////////////////////////////////////////////////
//Mainfrm.cpp
//////////////////////////////////////////////////
BOOL CMainFrame::CreateRibbonBar()
{
...
m_pRibbonBar = (CCustomizedRibbonBar*)pCommandBars->Add(_T("TEST"), xtpBarTop, RUNTIME_CLASS(CCustomizedRibbonBar));
...
}


Posted By: iamthewind
Date Posted: 16 November 2007 at 4:35am
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);



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net