5,692,513 members and growing! (16,655 online)
Email Password   helpLost your password?
Platforms, Frameworks & Libraries » Win32/64 SDK & OS » General     Intermediate

Add Windows XP Theme Style to your current projects

By Jiang Hong

Add Windows XP Theme Style to your current projects
VC6, C++Windows, NT4, Win2KVS6, Visual Studio, Dev

Posted: 6 Sep 2001
Updated: 6 Sep 2001
Views: 314,189
Bookmarked: 106 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
85 votes for this Article.
Popularity: 8.50 Rating: 4.40 out of 5
1 vote, 1.7%
1
4 votes, 6.9%
2
1 vote, 1.7%
3
6 votes, 10.3%
4
46 votes, 79.3%
5

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 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

About the Author

Jiang Hong



Location: China China

Other popular Win32/64 SDK & OS articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 25 of 134 (Total in Forum: 134) (Refresh)FirstPrevNext
GeneralTheme not working in DllmemberMember 46470293:07 29 Jun '08  
QuestionEmbed XP theme in an application without manifest [modified]memberbasawaraj21:39 15 May '08  
GeneralVS2005memberjosip cagalj4:30 12 Dec '07  
GeneralRe: VS2005memberbasawaraj21:43 15 May '08  
QuestionWhat about controls in a DLL?memberRolling Justin3:27 9 Sep '07  
GeneralIE Toolbarmemberansif_pi23:55 16 Jul '07  
GeneralRe: IE ToolbarmemberRafael.Franco3:08 17 Jul '07  
GeneralRe: IE Toolbarmembercanido5:29 2 Oct '07  
GeneralProblem with Button when using XP StylememberTobetheWinner3:04 20 Jun '07  
Generalno focus rectangle in buttonsmemberconxita9:06 15 Apr '07  
GeneralCan't change text color of check boxmemberPei23:06 25 Mar '07  
GeneralTips for VS 2005memberWarren Stevens7:47 21 Mar '07  
QuestionXp style problem in Visual Studio 2005memberVinod Moorkkan1:18 17 Feb '07  
AnswerRe: Xp style problem in Visual Studio 2005memberKarstenK4:23 19 Feb '07  
Generaleasier in VS2005memberc_srishti18:23 23 Dec '06  
GeneralTHANK YOU! THANK YOU! THANK YOU! THANK YOU!memberMaster_God9:31 12 Nov '06  
GeneralSuch aGOOD WORK!memberCoolboy12320:53 24 Sep '06  
GeneralVS2005memberJames Poag3:57 19 Jul '06  
Generalx64 manifestmembergotomy14:39 4 Jun '06  
GeneralRe: x64 manifest [modified]membergotomy12:59 6 Jun '06  
QuestionApplication configuration is incorrectmemberKinnos6:49 30 Jan '06  
JokeRe: Application configuration is incorrectmemberFiberman21:43 14 Feb '06  
GeneralRe: [ThnakYou!!]Application configuration is incorrectmembereojun816:39 25 Dec '06  
GeneralRe: Application configuration is incorrectmemberAnil K P5:04 20 Feb '07  
GeneralStrange behaviour when changing the editbox control colormemberyttham0:08 8 Jan '06  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 6 Sep 2001
Editor: Smitha Vijayan
Copyright 2001 by Jiang Hong
Everything else Copyright © CodeProject, 1999-2008
Web19 | Advertise on the Code Project