|
Тема |
Re: Window XP interface + VB 6.0 [re: AZure] |
|
Автор |
Wise Guy (да бе умен...) |
|
Публикувано | 26.02.02 11:54 |
|
|
Xp visual style in your application without any components
Without using any components
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.
Ako iskash Tip-ovete da sa s shadow (na XP sa), shte ti trqbva oshte. Imam vsi4ko, no e za Delphi, i ne znam dali mojesh da si go prevedesh
by Wise Guy
|
| |
|
|
|