Click here to Skip to main content
6,291,722 members and growing! (14,076 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
VC6Win2K, Dev
Posted:6 Sep 2001
Views:344,247
Bookmarked:115 times
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
86 votes for this article.
Popularity: 8.53 Rating: 4.41 out of 5
1 vote, 1.7%
1
4 votes, 6.8%
2
1 vote, 1.7%
3
6 votes, 10.2%
4
47 votes, 79.7%
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


Member

Location: China China

Other popular Win32/64 SDK & OS articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 25 of 136 (Total in Forum: 136) (Refresh)FirstPrevNext
GeneralTheme not working in Dll PinmemberMember 46470293:07 29 Jun '08  
QuestionEmbed XP theme in an application without manifest [modified] Pinmemberbasawaraj21:39 15 May '08  
GeneralVS2005 Pinmemberjosip cagalj4:30 12 Dec '07  
GeneralRe: VS2005 Pinmemberbasawaraj21:43 15 May '08  
GeneralRe: VS2005 PinmemberMaou11:53 3 Jan '09  
QuestionWhat about controls in a DLL? PinmemberRolling Justin3:27 9 Sep '07  
GeneralIE Toolbar Pinmemberansif_pi23:55 16 Jul '07  
GeneralRe: IE Toolbar PinmemberRafael.Franco3:08 17 Jul '07  
GeneralRe: IE Toolbar Pinmembercanido5:29 2 Oct '07  
GeneralProblem with Button when using XP Style PinmemberTobetheWinner3:04 20 Jun '07  
Generalno focus rectangle in buttons Pinmemberconxita9:06 15 Apr '07  
GeneralCan't change text color of check box PinmemberPei23:06 25 Mar '07  
GeneralTips for VS 2005 PinmemberWarren Stevens7:47 21 Mar '07  
QuestionXp style problem in Visual Studio 2005 PinmemberVinod Moorkkan1:18 17 Feb '07  
AnswerRe: Xp style problem in Visual Studio 2005 PinmemberKarstenK4:23 19 Feb '07  
Generaleasier in VS2005 Pinmemberc_srishti18:23 23 Dec '06  
GeneralRe: easier in VS2005 PinmemberMember 42313910:18 21 Apr '09  
GeneralTHANK YOU! THANK YOU! THANK YOU! THANK YOU! PinmemberMaster_God9:31 12 Nov '06  
GeneralSuch aGOOD WORK! PinmemberCoolboy12320:53 24 Sep '06  
GeneralVS2005 PinmemberJames Poag3:57 19 Jul '06  
Generalx64 manifest Pinmembergotomy14:39 4 Jun '06  
GeneralRe: x64 manifest [modified] Pinmembergotomy12:59 6 Jun '06  
QuestionApplication configuration is incorrect PinmemberKinnos6:49 30 Jan '06  
JokeRe: Application configuration is incorrect PinmemberFiberman21:43 14 Feb '06  
GeneralRe: [ThnakYou!!]Application configuration is incorrect Pinmembereojun816:39 25 Dec '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-2009
Web17 | Advertise on the Code Project