Click here to Skip to main content
15,886,137 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 609.3K   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

 
QuestionOwnerdraw detect XP or Win9x? Pin
3-Apr-02 20:00
suss3-Apr-02 20:00 
QuestionHow to do this in C#? Pin
Domenic Denicola9-Mar-02 18:12
Domenic Denicola9-Mar-02 18:12 
AnswerRe: How to do this in C#? Pin
10-May-02 23:51
suss10-May-02 23:51 
GeneralFlat Scrollbars Pin
Takeru Koushirou18-Feb-02 11:03
Takeru Koushirou18-Feb-02 11:03 
GeneralAWESOME Pin
Swinefeaster6-Feb-02 23:16
Swinefeaster6-Feb-02 23:16 
Generaledit problem Pin
16-Nov-01 0:56
suss16-Nov-01 0:56 
GeneralWinXP visual styles Pin
kasturirawat9-Nov-01 7:41
kasturirawat9-Nov-01 7:41 
GeneralRe: WinXP visual styles Pin
Alan Wen11-Nov-01 17:53
Alan Wen11-Nov-01 17:53 
In "winuser.rh" of the latest version of Platform SDK, include the following lines:

#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1

#define RT_MANIFEST 24

Is this make sense?

Wink | ;)

Alan Wen
GeneralRe: WinXP visual styles Pin
kasturirawat12-Nov-01 6:00
kasturirawat12-Nov-01 6:00 
Generaldon't support chinese (GB2312) Pin
24-Sep-01 21:08
suss24-Sep-01 21:08 
GeneralToolbar problems Pin
20-Sep-01 5:58
suss20-Sep-01 5:58 
GeneralRe: Toolbar problems Pin
4-Oct-01 10:25
suss4-Oct-01 10:25 
GeneralRe: Toolbar problems Pin
5-Oct-01 22:39
suss5-Oct-01 22:39 
GeneralRe: Toolbar problems Pin
6-Oct-01 14:06
suss6-Oct-01 14:06 
GeneralRe: Toolbar problems Pin
6-Nov-01 12:53
suss6-Nov-01 12:53 
GeneralRe: Toolbar problems Pin
4-Dec-01 11:48
suss4-Dec-01 11:48 
GeneralRe: Toolbar problems Pin
6-Feb-02 15:55
suss6-Feb-02 15:55 
GeneralRe: Toolbar problems Pin
Swinefeaster7-Feb-02 0:41
Swinefeaster7-Feb-02 0:41 
GeneralRe: Toolbar problems Pin
Matban13-Mar-02 5:08
Matban13-Mar-02 5:08 
GeneralRe: Toolbar problems Pin
6-Apr-02 17:20
suss6-Apr-02 17:20 
GeneralRe: Toolbar problems Pin
mcbain17-Jan-02 2:24
mcbain17-Jan-02 2:24 
GeneralRe: Toolbar problems Pin
6-Apr-02 16:42
suss6-Apr-02 16:42 
GeneralRe: Toolbar problems - SOLUTION! Pin
8-Apr-02 23:01
suss8-Apr-02 23:01 
GeneralRe: Toolbar problems - SOLUTION! Pin
8-Apr-02 23:08
suss8-Apr-02 23:08 
GeneralRe: Toolbar problems Pin
5-Apr-02 18:22
suss5-Apr-02 18:22 

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.