简体   繁体   English

是否可以将Windows功能区控件修改为更像使用现有API的MS Word 2010中的功能区

[英]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. 我目前正在使用C ++和WINAPI开发桌面应用程序。 I want to use a ribbon control for the application's main window (like the sort found in the newer office applications). 我想对应用程序的主窗口使用功能区控件(例如在较新的Office应用程序中找到的排序)。 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. 我已经成功创建了XML文件,COM接口,并且还设法将功能区显示在应用程序窗口中。

The ribbon currently appears like the ribbon in MS Paint. 功能区当前看起来像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. 我一直在尝试自定义功能区,以使其看起来更像MS Word 2010中的功能区。

The changes I am trying to exact are: 我尝试进行的更改是:

1) Centering the title of the application in the title bar 1)在标题栏中居中显示应用程序的标题

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) 2)使标题栏淡入\\合并到功能区中(与窗口框架的边界并列,在标题栏和功能区之间画一条线)

3) Moving the "customize quick access bar" menu to the right of the vertical separator. 3)将“自定义快速访问栏”菜单移至垂直分隔符的右侧。

4) Changing the blue button at the far left of the ribbon so that it has the word "File" on it 4)更改功能区最左侧的蓝色按钮,使其上面带有“文件”字样

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. 我在很大程度上没有成功,因为功能区似乎无法使用Microsoft公开的接口和API以这种方式进行自定义。

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). 因此,我的问题是:是否有一种方法可以使用现有的Ribbon API创建上述效果,还是MS Office功能区是未记录功能的结果,甚至可能是大量黑客入侵(枚举窗口句柄并违反了界面边界) )。

You won't be able to customize the Windows Ribbon Framework in a way that it looks and behaves like the Office Ribbon. 您将无法以类似于Office Ribbon的外观和行为自定义Windows Ribbon Framework。 Not even wrapper projects such as Windows Ribbon for WinForms (.NET) or the Windows Ribbon Framework for Delphi provide such a feature. 甚至包装程序项目(例如WinForms的Windows Ribbon (.NET)或DelphiWindows Ribbon框架 )也没有提供此功能。

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. Office Ribbon (在Office 2007中引入)和Windows Ribbon框架 (在Windows 7中引入)是Ribbon概念的两个完全不同的实现。 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. Microsoft提供了更多的Ribbon实现,请参见WPF Ribbon和MFC Ribbon,它们均提供不同的功能和不同的外观。

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. 尽管可以在自己的桌面应用程序中轻松使用Windows Ribbon框架和WPF功能区,但不能在Office应用程序中使用本机Office功能区。 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.. 如果您确实想在功能区栏上提供C ++桌面应用程序中Office功能区的外观,则必须编写自己的实现或使用第三方组件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM