Click here to Skip to main content
15,884,298 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.1K   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

 
GeneralRe: Problem with checkboxes on tab pages Pin
Paul Vickery25-Jan-05 22:37
professionalPaul Vickery25-Jan-05 22:37 
GeneralRe: Problem with checkboxes on tab pages Pin
ralfsch25-Jan-05 23:14
ralfsch25-Jan-05 23:14 
GeneralRe: Problem with checkboxes on tab pages Pin
Vikrant for VC++8-Apr-05 21:46
Vikrant for VC++8-Apr-05 21:46 
GeneralRe: Problem with checkboxes on tab pages Pin
peterchen13-Jul-08 22:50
peterchen13-Jul-08 22:50 
GeneralSmall and simple. Pin
Prakash Nadar24-Apr-04 3:56
Prakash Nadar24-Apr-04 3:56 
GeneralProblem Pin
asv20-Apr-04 19:08
asv20-Apr-04 19:08 
GeneralRe: Problem Pin
Prakash Nadar24-Apr-04 3:55
Prakash Nadar24-Apr-04 3:55 
GeneralRe: Problem Pin
RancidCrabtree22-Nov-05 11:12
RancidCrabtree22-Nov-05 11:12 
GeneralRe: Problem Pin
argez19-Apr-06 11:51
argez19-Apr-06 11:51 
GeneralProblem Pin
one_eddie10-Apr-04 11:06
one_eddie10-Apr-04 11:06 
GeneralUnable to get output Pin
asv26-Feb-04 17:17
asv26-Feb-04 17:17 
GeneralRe: Unable to get output Pin
Thomas Freudenberg27-Feb-04 3:29
Thomas Freudenberg27-Feb-04 3:29 
QuestionHow many times does this article need to be rewritten? Pin
Joe Sonderegger2-Dec-03 4:51
Joe Sonderegger2-Dec-03 4:51 
AnswerRe: How many times does this article need to be rewritten? Pin
Anonymous12-Feb-04 11:45
Anonymous12-Feb-04 11:45 
AnswerRe: How many times does this article need to be rewritten? Pin
mtconleyuk3-Mar-04 8:58
mtconleyuk3-Mar-04 8:58 
GeneralRe: How many times does this article need to be rewritten? Pin
Anonymous24-Apr-04 3:45
Anonymous24-Apr-04 3:45 
GeneralRe: How many times does this article need to be rewritten? Pin
RancidCrabtree22-Nov-05 11:15
RancidCrabtree22-Nov-05 11:15 
GeneralComboBox problem Pin
rparrella111-Jul-03 8:02
rparrella111-Jul-03 8:02 
GeneralRe: ComboBox problem Pin
rparrella111-Jul-03 9:44
rparrella111-Jul-03 9:44 
GeneralRe: oh, thanks Pin
mem4you29-Sep-03 20:55
mem4you29-Sep-03 20:55 
GeneralWOW - what a great article! Pin
Yovav17-Jun-03 14:40
Yovav17-Jun-03 14:40 
GeneralButtons with bitmaps Pin
Cory Albrecht12-Jun-03 6:33
Cory Albrecht12-Jun-03 6:33 
GeneralRe: Buttons with bitmaps Pin
Anonymous22-Sep-04 7:41
Anonymous22-Sep-04 7:41 
GeneralRe: Buttons with bitmaps Pin
Kier Dugan24-Sep-04 2:11
Kier Dugan24-Sep-04 2:11 
Questionoffice 2003 style?? Pin
schaereran@gmx.net5-Jun-03 2:25
schaereran@gmx.net5-Jun-03 2:25 

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.