|
Тема
|
Window XP interface + VB 6.0
|
|
Автор |
AZure (-/\-) |
Публикувано | 26.02.02 02:08 |
|
Здравейте,
Имам Visual Basic 6.0 под Windows XP,
обаче за съжаление, нито бутоните нито останалите
контроли изглеждат (готино :-)) както останалите приложения
по WinXP.
Някакви идеи за това как мога да ни направя такива?
Благодаря предварително! 
The world is AZure-colored
| |
Тема
|
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
| |
Тема
|
Re: Window XP interface + VB 6.0
[re: AZure]
|
|
Автор | ZahiCal (Нерегистриран) |
Публикувано | 26.02.02 11:58 |
|
Probvaj tuk:
http://msdn.microsoft.com/library/en-us/dnwxp/html/xptheming.asp?frame=true
Dosta podrobno e objasneno, samo deto statijata e za VC++, no sa objasneni osnovnite momenti (definiraj manifest, vkljutchi go v RESOURCE-a na exe-to i t.n.)
| |
Тема
|
Re: Window XP interface + VB 6.0
[re: AZure]
|
|
Автор | dsgfsd (Нерегистриран) |
Публикувано | 26.02.02 13:11 |
|
Vij i tova:
http:// msdn.microsoft.com/library/en-us/dv_vstechart/html/
vbtchusingwindowsxpvisualstyleswithcontrolsonwindowsforms.asp
| |
Тема
|
Re: Window XP interface + VB 6.0
[re: AZure]
|
|
Автор |
ironcode (новак) |
Публикувано | 26.02.02 13:51 |
|
Да, точно така става, правиш си manifest XML файл, и го пъхаш в ресурсите. Правил съм го с Visual C++ 6.0, работи си идеално.
За повече информация виж в Platform SDK Documentation\User Interface Services\Windows Shell\Shell Programmers Guide\Visual Styles\Using Windows XP Visual Styles.
| |
|
Здравейте,
Благодаря Ви на всички за отговорите, все пак не спирайте да публикувате тук вашите мнения, ако има все още такива.
Значи направих си manifest файл и връзка към Comctl32.dll като извиквам InitCommonControls(). Само така успях, за сега.
Обаче, без да пъхам НИЩО в ресурсите, защото нещо неуспях (става въпрос за Visual Basic). Там си слага кавички на имената които давам и затова явно не става. Но все пак аз ще продължа да опитвам да го вмъкна в ресурсите, вместо да има отделен ime.exe.manifest файл.
Благодаря ви за ценната помощ!
The world is AZure-colored
| |
Тема
|
Re: До някъде успях :-)
[re: AZure]
|
|
Автор |
Плaмeн (мързелив едиот) |
Публикувано | 27.02.02 05:40 |
|
добави следното в ресурсния си файл:
#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
#define RT_MANIFEST 24
Пламен
| |
Тема
|
Re: До някъде успях :-)
[re: Плaмeн]
|
|
Автор |
ironcode (новак) |
Публикувано | 27.02.02 17:54 |
|
Да, без ръчно пипане в Ресурс файла няма да стане.
Прави се така:
#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
MANIFEST_RESOURCE_ID RT_MANIFEST "YourApp.manifest"
А в програмата това:
#define MANIFEST_RESOURCE_ID 2
| |
|
|
|
|