Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPRibbonTab handle WM_LBUTTONDOWN...?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPRibbonTab handle WM_LBUTTONDOWN...?

 Post Reply Post Reply
Author
Message
iamthewind View Drop Down
Newbie
Newbie


Joined: 11 September 2007
Location: China
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote iamthewind Quote  Post ReplyReply Direct Link To This Post Topic: CXTPRibbonTab handle WM_LBUTTONDOWN...?
    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
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 05 November 2007 at 4:18am
Hello,
 
You have override CXTPRibbonBar and catch its WM_LBUTTONDOWN message.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
iamthewind View Drop Down
Newbie
Newbie


Joined: 11 September 2007
Location: China
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote iamthewind Quote  Post ReplyReply Direct Link To This Post 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));
...
}
Back to Top
iamthewind View Drop Down
Newbie
Newbie


Joined: 11 September 2007
Location: China
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote iamthewind Quote  Post ReplyReply Direct Link To This Post 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);
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.063 seconds.