Search code examples
c++winapicomwindows-ribbon-framework

Can the windows ribbon control be modified to look more like the ribbon in MS Word 2010 using the existing APIs


I am currently working on a desktop application using C++ and WINAPI. I want to use a ribbon control for the application's main window (like the sort found in the newer office applications). I have successfully created the XML file, the COM interfaces and I have also managed to get the ribbon to show up in the application window.

The ribbon currently appears like the ribbon in MS Paint. (Sorry I can't post images).

I have been trying to customize the ribbon such that it appears more like the ribbon in MS Word 2010.

The changes I am trying to exact are:

1) Centering the title of the application in the title bar

2) Getting the title bar to fade\merge into the ribbon (as apposed to the border of the window's frame drawing a line between the title bar and the ribbon)

3) Moving the "customize quick access bar" menu to the right of the vertical separator.

4) Changing the blue button at the far left of the ribbon so that it has the word "File" on it

I have been largely unsuccessful because the ribbon does not seem to be customizable in this way using the interfaces and APIs exposed by Microsoft.

My question is thus: Is there a way to create the effects mentioned above using the existing ribbon API, or is the MS Office ribbon a result of undocumented features or possibly even a lot of hacking (Enumerating window handles and violating the boundaries of the interface).


Solution

  • You won't be able to customize the Windows Ribbon Framework in a way that it looks and behaves like the Office Ribbon. Not even wrapper projects such as Windows Ribbon for WinForms (.NET) or the Windows Ribbon Framework for Delphi provide such a feature.

    The Office Ribbon (introduced with Office 2007) and the Windows Ribbon Framework (introduced with Windows 7) are two completely different implementations of the Ribbon concept. There are even more Ribbon implementations from Microsoft, see the WPF Ribbons and the MFC Ribbons, all of them providing different features and a different look'n'feel.

    While the Windows Ribbon Framework and the WPF Ribbons can be used quite easy in your own desktop application, you cannot use the native Office Ribbons out of an Office application. If you really want to have a Ribbon bar that that provides the look'n'feel of the Office Ribbons in your C++ desktop application, you'll either have to write your own implementation or use a third party component..