Results 1 to 9 of 9

Thread: [RESOLVED] Windows XP styles

  1. #1

    Thread Starter
    Fanatic Member dom_stapleton's Avatar
    Join Date
    Sep 2005
    Location
    Leigh-on-Sea, UK
    Posts
    665

    Resolved [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!
    I use Microsoft Visual Basic 2008 Express Edition.

    If my post has been helpful, please rate it, unless you don't believe in Karma... which actually I don't!

    Resources:
    Visual Basic Tutorials (1, 2) | MSDN Library | Google | Krugle | Search Forums

    Free components:
    Windows Forms Components | XP Common Controls Library

  2. #2
    Hyperactive Member wiccaan's Avatar
    Join Date
    Apr 2004
    Location
    127.0.0.1
    Posts
    475

    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

  3. #3
    New Member
    Join Date
    Jun 2006
    Posts
    15

    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---

  4. #4
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    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

  5. #5
    New Member
    Join Date
    Jun 2006
    Posts
    15

    Re: Windows XP styles

    Quote 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.........

  6. #6
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Windows XP styles

    Quote 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

  7. #7
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Windows XP styles

    Quote 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.

  8. #8
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    269

    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!

  9. #9
    Hyperactive Member wiccaan's Avatar
    Join Date
    Apr 2004
    Location
    127.0.0.1
    Posts
    475

    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
  •  



Click Here to Expand Forum to Full Width