|
-
Aug 13th, 2006, 02:08 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] Windows XP styles
Hi guys! I am just starting out with using ASM and I would like to know how I can enable the Windows XP theme styles my the program's controls. I know that with VB it is possible to use a manifest file, but I was wondering if there is an alternative method for ASM or if it is the same.
Thanks in advance!
-
Aug 13th, 2006, 08:13 AM
#2
Hyperactive Member
Re: Windows XP styles
In ASM, its pretty much the same sence.
Just, you dont use a manifest file the same way.
As said on the original MS site:
http://msdn.microsoft.com/library/de.../xptheming.asp
An overview for easier use:
1. Include The ComCtl32 includes in your project, adding the following to your lib list.
Code:
include Comctl32.inc
includelib Comctl32.lib
2. Invoke the main call to use the library settings:
Code:
invoke InitCommonControls
This is added to your main startup code, like this:
Code:
.code
start:
invoke GetModuleHandle, NULL
mov hInstance, eax
invoke InitCommonControls
3. Create the manifest style file, create a file named theme.txt and add:
Code:
<?xml version="1.0" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="M" type="win32"/>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*"/>
</dependentAssembly>
</dependency>
</assembly>
4. Last but not least, add the theme.txt file to your project by adding it to your .rc file like this:
Code:
1 24 DISCARDABLE "theme.txt"
If my post was helpful please rate it 
-
Aug 27th, 2006, 04:17 AM
#3
New Member
Re: Windows XP styles
I am not an expert in assembly. I am also a newbie. There is no need of such long codes to create xpstyle in assembly. You need just a .xml file with an ID 1; which will make the dialog xp style. For eg.
1. save the text in the box as .xml with what ever name you like
<?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="Your Programe name.exe"/>
<description>Mx XP Program</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
publicKeyToken="6595b64144ccf1df"
language="*"
processorArchitecture="x86"/>
</dependentAssembly>
</dependency>
</assembly>
2. Add this .xml file to your project as a resource and make its ID 1. And when compile
the .rc add the below text if its not there
1 24 DISCARDABLE "XPSTYLE.xml"
where XPSTYLE is the name given by me. In my practice it will also work even when u add different name to xml other than the name of your program.
---CrystalClear---
-
Aug 27th, 2006, 03:42 PM
#4
Re: Windows XP styles
You realise what you just said was already said in the post above yours right? Those are called manifest files..
chem
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Aug 28th, 2006, 06:43 AM
#5
New Member
Re: Windows XP styles
 Originally Posted by chemicalNova
You realise what you just said was already said in the post above yours right? Those are called manifest files..
chem
By the method i said u don't want to include any dlls nor invoke any initcommoncontrols. I am adding just a file in the .xml format. the previous format added a file as .txt. As far as i know the usage of comcat32.dll means that the chance of running that app in 98 in minimal. I am not calling any extra dlls and apis.........
-
Aug 28th, 2006, 10:22 AM
#6
Re: Windows XP styles
 Originally Posted by CrystalClear
By the method i said u don't want to include any dlls nor invoke any initcommoncontrols. I am adding just a file in the .xml format. the previous format added a file as .txt. As far as i know the usage of comcat32.dll means that the chance of running that app in 98 in minimal. I am not calling any extra dlls and apis.........
Haha yes, but look at the actual files above (what you posted, and what was posted before you). Both are saying to use the Windows Common Controls. Either way, they're both the same They even call for the same version and public key!
chem
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Aug 28th, 2006, 11:49 PM
#7
Re: Windows XP styles
 Originally Posted by CrystalClear
By the method i said u don't want to include any dlls nor invoke any initcommoncontrols. I am adding just a file in the .xml format. the previous format added a file as .txt. As far as i know the usage of comcat32.dll means that the chance of running that app in 98 in minimal. I am not calling any extra dlls and apis.........
You're correct about Windows 98. That's why you must check the operating system version before calling InitCommonControls. Which you should call so that all controls draw properly.
Additionally, the code posted in post #2 uses MASM macros. Calling Win32 library functions through pure assembly takes more work.
-
Sep 8th, 2006, 11:24 PM
#8
Hyperactive Member
Re: Windows XP styles
The manifest file work perfect on XP, when running the vb6 application. all control show properly, but when run on the W2000 pro, the effect not work. just back to normal vb6 control.
Any idea? how to make the vb6 app. running on W2000 with xp style control?
Thanks!
-
Sep 9th, 2006, 01:50 AM
#9
Hyperactive Member
Re: Windows XP styles
Windows 2000 doesnt have XP control styles. Its not reverse compatible. 2000 was not designed in mind to be able to do things that XP can do. So you do not have that style ability in 2000. In order to do it, you would have to make your own controls or use pictures and such to make it look / feel like XP.
If my post was helpful please rate it 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|