delphi3000.com - the free delphi knowledge platform
delphi3000.com - the free delphi knowledge platform
500 Users Online NOW
Have a look at your member-status

connecting people's knowledge


  - Recent ArticlesRSS feed for Recent Articles on delphi3000.com
  - List of All Articles
  - Top Viewed Articles
  - Articles (+Attachem.)
  - Articles Of Interest
  - Categories
  - Top Uploader
  - Search
  - Index

  - My Home
  - Submit an Article
  - My Articles
  - My Personal Data
  - My Bookmarks
  - Activities
  - Login/Logout

  - Sign Up
  - Why Sign Up
  - Newsletter

  - Press
  - Advertise

  - Contact
  - Feedback





Community
Borland
ClubeDelphi
Dr. Bob
UK-BUG
Delphi Meetings
Planeta Delphi



Loremo - the 1.5 liter car coming in 2009




Startblatt.de






Share this article with friendsShare this article with friends
Rate this articleRate this article - to keep the quality of delphi3000.com !
Comment this article or read through previous comments (11)


Windows Xp Visual-Style in your app. in 2 seconds (w/o components)Format this article printer-friendly!Bookmark function is only available for registered users!
Without using any components
Product:
Delphi all versions
Category:
Multimedia
Skill Level:
Scoring:
Last Update:
01/17/2002
Search Keys:
delphi delphi3000 article borland vcl code-snippet WindowsXP winxp visual-style resource 6595b64144ccf1df
Times Scored:
8
Visits:
7537
Uploader: mega warrior
Company:
Reference: msdn.microsoft.com
 
Question/Problem/Abstract:
Every application i create in Delphi doesnt have WinXP visual styles implemented automatically, is there any way i can do this without using any component?
Answer:



Windows XP visual styles does not integrate into our application automatically.
I was looking for a way to make my form look much more attractive under WinXP, so i was looking around for an article to help me do that.
when i havent found any i decided to write this small article to explain how in a minor of 1 second you can make your basic-looking-controls-form change its look and plugin into WinXP skins.
as you should see its all depends on 1 small text resource.

first create a new text file and call it "XpXML.txt" (place it in your project folder) inside it paste the following lines:


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
    name="Hacx.Simple.Xp.Resource"
    processorArchitecture="x86"
    version="1.1.0.0"
    type="win32"/>
<description>Windows Shell</description>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="x86"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
</assembly>


i think its self explaining, and there are few fields you can change like: name, version, description.. they doesnt affect the actual layout.
publicKeyToken is very important and should not be changed in any manner (just go to msdn.microsoft.com and look for "6595b64144ccf1df" to read some articles about it).

ok, second thing is to add another text file to your project called "XpRes.RC" and paste the following lines inside it:

1   24       XpXML.txt

now, the deal is not to forget to add this resource to your project by choosing "Add to Project" and choose the resource file "XpRes.RC".
some might ask what is "24", well its a common sign declared by microsoft to notify Windows.Shell that this application should have Windows XP visual styles (Skins) wrapped around it.

the only thing to do now is to "Build" the project and execute it.
place a listview with columns and some buttons to see the real change if your just testing this article on a blank form.

thats it, just execute and see how well it goes.





Please rate this article!
Skill level:
BeginnerExpert

Useful:
No!Very!

Overall rating:
PoorExcellent



Comments to this article
Write a new comment
GraphicalForm
    sajad123456 b (Aug 6 2006 12:03AM)

Can I have a FullGraphicalyForm just like YahooWeather ?
because when I see YahooWeather file's, that was XML source.
Respond

It's really worsk
    pablo glez (Jun 10 2006 8:38PM)

just take a minute, now it looks better
Thanks...
Respond

pls help me
    Hello everyone (Feb 1 2005 12:43AM)

i lost my original windows XP style.
how i get back the windows XP style default?
Respond

YES GREAT
    Tarek Mansour (May 20 2002 3:52PM)

Thank you for such a great article, you are the best.
Respond

Error with TListView
    Richard Wilkinson (Mar 11 2002 8:15AM)

I get an EAccessViolation whenever I use the above in a project with a TListView in report view. My test program was a blank application, with a single TListView in the center. Then I changed ViewStyle to vsReport, and added one column. That runs OK, then add the resource from above and the program no longer runs. I use Delphi 6 Enterprise on WinXP. Am I the only one getting this error?
Respond

RE: Error with TListView
anonymus (Mar 11 2002 10:18PM)

I'm getting the same problem with my Delphi 6
Respond

RE: Error with TListView
Radegast (Sep 19 2004 8:59PM)

Are you using XP visual style ? I found that I not use *.exe.manifest, this AV is not occured ...

Regards Radegast
Respond

TDBLookUpCmboBox !!!
    Abdulaziz Jasser (Jan 21 2002 11:12PM)

Hi…
How can make TDBLookUpCmboBox appears in Windows XP style.  The TComboBox control has the Windows XP style, but the TDBLookUpCmboBox does not.
Thanks again...


Respond

Another Windows version.
    Abdulaziz Jasser (Jan 10 2002 5:55PM)

A big thanks to you for this excellent article. One thing to ask, what happen when I run this new executable file on another Windows version? Well every thing will be OK?
Respond

RE: Another Windows version.
Casper Steinmann (Jan 10 2002 6:19PM)

WinXP comes with 2 versions of the comCtl32.dll (common controls) - the old version 5.x and the new version 6 - when you compile the resourcefile into your app - you simple just make it XP-ready. yours and others old win9x/me/2k doesn't recognize the resource and does nothing about it (because it can't) WinXP however can enable the comCtl32.dll ver. 6 and enable the new XP theme!

Casper
Respond

RE: Another Windows version.
Mega Warrior (Jan 10 2002 7:32PM)

well, there wont be any change to your application when running under another Windows version as the only thing you add to it is another resource which is ignored in other Windows version.
Respond














 
Sign up to consume product discounts for Bronze memberships !

read more


  Visit our Sponsor

 

  Community Ad of
M. Maes
 
   














 







     
  Copyright © 2000 - 2007 delphi3000.com - All rights reserved. Terms of use. || Privacy
delphi3000.com is a service by bluestep.com IT-Services GmbH (Vienna)