Click here to Skip to main content
15,891,033 members
Articles / Programming Languages / C++
Article

Add Windows XP Theme Style to your current projects

Rate me:
Please Sign up or sign in to vote.
4.84/5 (65 votes)
6 Sep 2001 611K   3.8K   132   145
Add Windows XP Theme Style to your current projects

Sample Image - xptheme.jpg

The following steps introduces XP Theme Style to your project:

  1. Insert Resource, choose "Custom", input "24" (without quotes) as resource type
  2. Copy and paste the following XML sheets into the editor.
    XML
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    <assembly 
       xmlns="urn:schemas-microsoft-com:asm.v1" 
       manifestVersion="1.0">
     <assemblyIdentity 
        processorArchitecture="x86" 
        version="5.1.0.0"
        type="win32"
        name="test.exe"/>
     <description>Test Application</description>
     <dependency>
      <dependentAssembly>
        <assemblyIdentity
             type="win32"
             name="Microsoft.Windows.Common-Controls"
             version="6.0.0.0"
             publicKeyToken="6595b64144ccf1df"
             language="*"
             processorArchitecture="x86"/>
      </dependentAssembly>
     </dependency>
    </assembly>

    You can replace test.exe and Test Application with any string you like. This will not affect the behaviour of the application.

  3. Change resource ID to 1.
  4. Add calls to InitCommonControls() in your WinMain(). Don't forget to include commctrl.h and link comctl32.lib. Rebuild your project, all done :-)

This special resource type is only recognized by Windows XP. In any other version of Windows (Windows 9x/NT/2000), the program simply runs as before.

You can also create a manifest file with the same name of the EXE file, plus an extension .manifest, which contains the same lines as the ones above. For our test.exe, the manifest file is test.exe.manifest.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
China China
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralVB 6.0 Pin
Armen Hakobyan8-Aug-02 23:04
professionalArmen Hakobyan8-Aug-02 23:04 
QuestionWhat about namespace extensions? Pin
Compholio19-Jul-02 23:17
Compholio19-Jul-02 23:17 
AnswerRe: What about namespace extensions? Pin
Anonymous20-Jul-02 21:49
Anonymous20-Jul-02 21:49 
GeneralCore API Application and manifest Pin
S van Leent26-Jun-02 7:04
S van Leent26-Jun-02 7:04 
GeneralRe: Core API Application and manifest Pin
AJKR7-Oct-03 3:43
AJKR7-Oct-03 3:43 
Generaladd windows xp theme style to your WebBrowser Pin
Leo Wang20-Jun-02 23:21
Leo Wang20-Jun-02 23:21 
GeneralMy OCX does not take XP style ! Pin
Emmanuel Derriey20-Jun-02 22:52
Emmanuel Derriey20-Jun-02 22:52 
GeneralRe: My OCX does not take XP style ! Pin
Anonymous20-Jul-02 21:45
Anonymous20-Jul-02 21:45 
Maybe this will help:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwxp/html/xptheming.asp

There is a section called "Using Visual Styles with a Custom Control" that probably has the information you are looking for.
QuestionHow about DLL? Pin
5-May-02 5:21
suss5-May-02 5:21 
AnswerRe: How about DLL? Pin
8-May-02 20:08
suss8-May-02 20:08 
GeneralRe: How about DLL? Pin
16-May-02 20:05
suss16-May-02 20:05 
GeneralRe: How about DLL? Pin
14-Jun-02 12:09
suss14-Jun-02 12:09 
GeneralAsked and answered Pin
21-Jun-02 5:54
suss21-Jun-02 5:54 
GeneralI cannot make it work Pin
namth20-Nov-02 8:39
namth20-Nov-02 8:39 
GeneralRe: I cannot make it work Pin
JustAGhost24-Oct-03 5:14
JustAGhost24-Oct-03 5:14 
GeneralRe: How about DLL? Pin
Frederic Marceau15-Apr-04 8:41
sussFrederic Marceau15-Apr-04 8:41 
GeneralHow it works Pin
beaster21-Jun-05 9:22
sussbeaster21-Jun-05 9:22 
Generalprobleme with tabctrl Pin
4-Apr-02 8:31
suss4-Apr-02 8:31 
GeneralRe: probleme with tabctrl Pin
16-Jun-02 10:49
suss16-Jun-02 10:49 
GeneralRe: probleme with tabctrl Pin
16-Jun-02 10:54
suss16-Jun-02 10:54 
GeneralRe: probleme with tabctrl Pin
Tibor Blazko11-Jun-03 20:26
Tibor Blazko11-Jun-03 20:26 
GeneralSOLVED! Re: probleme with tabctrl Pin
mediamaster4011-Nov-02 11:21
mediamaster4011-Nov-02 11:21 
GeneralRe: SOLVED! Re: probleme with tabctrl Pin
Tibor Blazko11-Jun-03 22:27
Tibor Blazko11-Jun-03 22:27 
GeneralRe: SOLVED! Re: probleme with tabctrl Pin
ralfsch25-Jan-05 5:42
ralfsch25-Jan-05 5:42 
GeneralRe: is it really a bug? Pin
Tibor Blazko6-Jun-03 3:40
Tibor Blazko6-Jun-03 3:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.