How do I make my application use the Windows theme?

后端 未结 5 1520
隐瞒了意图╮
隐瞒了意图╮ 2021-02-06 15:56

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 lo

5条回答
  •  孤城傲影
    2021-02-06 16:28

    In Visual Styles Reference: Functions of MSDN, I found an interesting functions, that is, SetWindowTheme(). It can be used to either to apply or remove visual style to/from a control/window, there are several steps need to be done to enable Visual Style in an application.

    To use Windows Theme api, you'll need JwaUxTheme unit of JEDI API Library.

    However, applying theme from Windows Theme files (.theme) to an application seems has to be done by turning off visual style from controls and write owner drawn controls based on information from .theme files. MSDN has a documentation about .theme file specification (see the first reference below).

    Some good references:

    • Creating and Installing Theme Files
    • Fully themed Windows Vista Controls
    • Creating Windows Vista Ready Applications with Delphi

    Is Windows Presentation Foundation (WPF) Themes bad? There is a code example how to load it here.

    If you use VCL, Theme Engine and Skin Engine has a complete support of themes for Windows XP.

    If beauty application is your priority (without supports for Windows themes), I think, BusinessSkinForm and DynamicSkinForm is the best choice.

提交回复
热议问题