如何使我的应用程序使用Windows主题?

如何使我的应用程序使用Windows主题?

问题描述:

我正在使用一些Windows API来创建一个小应用程序。
我已经创建了按钮,窗口,好的。

I'm working with some windows API to create a little application. I already created the buttons, windows, alright.

但问题是我创建的组件看起来不像操作系统主题。他们看起来很简单:

But the problem is the components I created don't look like the OS theme. They look very simple:

以按钮为例。

如何启用Windows主题?它可以在C或Delphi中。

How do I enable the Windows theme? It can be in C or Delphi.

对于使用Windows控件的应用程序,这在这个msdn文章

For an application using windows controls, that is documented in this msdn article

编辑:为了缩短故事时间,如果要使用新的样式控件,则Windows需要知道应用程序。一些较旧的应用程序与XP及以后的新皮肤外观不兼容。因此,每个exe应该在清单中声明哪个版本是兼容的,即可执行文件中的一个嵌入的xml文件。清单用于其他事情,例如声明您是或不兼容的(DLL版本,120 dpi)以及免注册。

To make a long story short, Windows needs to know for an application if it was intended to use the new style controls. Some older apps just aren't compatible with the new skinned looks of XP and later. Each exe should therefore declare with which version it is compatible in a manifest, an embedded xml file in the executable. The manifest is used for other things like declaring what you are or aren't compatible with (DLL versions, 120 dpi) as well as registration-free com.