Solved

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

Posted on 2003-11-13
5
1,167 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now