CMFCRibbonQuickAccessCustomizeButton
How to get a pointer to the customize button that belongs to the CMFCRibbonBar in Visual Studio 2010?
Or, what I really need is to change the tooltip message for the CMFCRibbonQuickAccessCustomizeButton, so please enlighten me if you know any other way to do this than calling its SetToolTipText method. I guess it should be possible by overriding PreTranslateMessage, but I do not know how to identify that particular message. I was only able to change the tooltip message when the button is pressed, but then of course it's too late.
Re: CMFCRibbonQuickAccessCustomizeButton
I'm not familiar with it, but can you use the ON_UPDATE CCmdUI mechanism that you'd use with other toolbar buttons and menu items?
Re: CMFCRibbonQuickAccessCustomizeButton
Thanks for your reply.
I suppose you mean ON_UPDATE_COMMAND_UI, but for that I need the ID of the control, right? Unfortunately, GetID() returns 0 if I call the button when it's clicked, so I don't have a clue.
Re: CMFCRibbonQuickAccessCustomizeButton
Quote:
Originally Posted by
TubularX
... Unfortunately, GetID() returns 0 if I call the button when it's clicked, so I don't have a clue.
What is GetID()? When and where from do you call it?
Do you mean the a button on the ribbon bar does not have an ID?
Re: CMFCRibbonQuickAccessCustomizeButton
@Victor,
Sorry, let me clarify...
GetID is a method of CMFCRibbonBaseElement (and CMFCRibbonQuickAccessCustomizeButton is derived from this class). It returns the command ID according to MSDN (http://msdn.microsoft.com/en-us/library/bb983812.aspx).
One way is to override CMFCRibbonBar::OnShowRibbonContextMenu (http://msdn.microsoft.com/en-us/library/cc665772.aspx), where parameter "pHit" can be dynamically casted to a CMFCRibbonQuickAccessCustomizeButton pointer. GetID() can be called via this pointer.
Well, since the returned ID is 0, it certainly seems like there is no ID. Otherwise it's not easliy retrievable as far as I can tell. All the documented subclasses of CMFCRibbonBaseElement has an ID, but I don't know about the rest (including the customize button).