CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2006
    Posts
    231

    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.

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    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?

  3. #3
    Join Date
    Aug 2006
    Posts
    231

    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.

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: CMFCRibbonQuickAccessCustomizeButton

    Quote Originally Posted by TubularX View Post
    ... 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?
    Victor Nijegorodov

  5. #5
    Join Date
    Aug 2006
    Posts
    231

    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).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured