Solved

D7: Disable XP manifest (XPman) support at run-time

Posted on 2003-11-13
5
1,207 Views
Last Modified: 2007-12-19
Hi Experts,

Under WinXP I use XP manifest to enable fancy buttons and borders on TEdit/ TListView/.. in my program. So I just add to the uses clause (uses ...XPman;) Unfortunately, it comes with a pice: there are several known comctl32.dll - related bugs that come with using XPman.pas For example: scroll bars style = flat does not work any more (they are either blue or standard gray bricks).
 
If running my program on Win2K machine I don't need XPman any more (and all problems that come with it) , and I recompile my program without <uses ..XPman>. This leaves me with 2 version of same programm for WinXP and Win2K OS's which is sad.

Q. Is there any way to get rid of XPman support in a run-time (say, if running on Win2K machine)?

Sincerely,
odissey1
0
Comment
Question by:odissey1
  • 3
  • 2
5 Comments
 
LVL 2

Accepted Solution

by:
Robn earned 150 total points
ID: 9747624
Win2K doesn't load the manifest file and it doesn't come with the themed controls like WinXP does.
If you want to be able to turn off this support in WinXP, stop using XPMan and create your own manifest file. This file is XML and if you name it the same name as your executable, WinXP will load the manifest. If you experience a lot of problems in your application because of this, remove the file from the folder or rename it and Windows will not theme the controls when your application starts again.

The file should be named myapp.exe.manifest

Here are the contents (you can tweak these values to better suit your application.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
   version="1.0.0.0"
   processorArchitecture="X86"
   name="Microsoft.VB6.VBnetStyles"
   type="win32"
/>
<description>myapp</description>
<dependency>
   <dependentAssembly>
     <assemblyIdentity
       type="win32"
       name="Microsoft.Windows.Common-Controls"
       version="6.0.0.0"
       processorArchitecture="X86"
       publicKeyToken="6595b64144ccf1df"
       language="*"
     />
   </dependentAssembly>
</dependency>
</assembly>

Hope this helps,
Rob
0
 
LVL 2

Author Comment

by:odissey1
ID: 9750510
Hi Rob,

Thank you for comment and suggestion. I need some time to experiment with it.
My concern with your approch is the same like using <uses ...XPman>. Supposedly, XP manifest does not do anything in Win2k. Unfortunately, this is not the case. If XPman is present (anywhere) in the program running in Win2k, it does affect general outlook. It should not, but it does  - this is comctl32.dll bug.

Example: put a ListView on a form and set scrool bar style  to Flat, run it on Win2k -- scroll bar is flat. Now add <uses ...XPman> and run it again -- scroll bar is 3D brick. And this is just very innocent bug, others are much worse.

Maybe there are some other approaches to my problem?
My problem is that my application works fine both in Win2K and WinXP without <uses ..XPman>. Of course, all controls are pained standard windows gray-brick style. It would be nice to enable somehow fancy buttons/combos etc. if application was started in WinXP. But how to do this?  

Sincerely,
Boris
P.S. I am adding extra 50 points since the question seems to be tough.
0
 
LVL 2

Expert Comment

by:Robn
ID: 9750671
My approach is different because XPMan links the resource into the application. My solution allows you to remove this file from the folder if you are having problems with the application or you want to install it to an OS other than XP. You could have your install script test for XP and if it is, then copy the manifest file into the folder.

Regards,
Rob
0
 
LVL 2

Author Comment

by:odissey1
ID: 9769427
Hi Rob,

Thank you for help. Since there are no any other comments on the subject I consider this is the way to go.

Sincerely,
Boris
0
 
LVL 2

Expert Comment

by:Robn
ID: 9787553
Glad I could help
Regards,
Rob
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question