Irwin Scollar wrote: >>CubicDesign wrote: >> >>Do you mean that XPMan is not compatible with Vista? > > XPMan is for XP only as far as I can determine, although it doesn't > seem to do any harm under Win2000 or WinNT4.
XPMan does exactly one thing: It links a manifest resource to your application. It does no harm to prior versions of Windows NT because Windows XP was the first to use manifests. To prior versions, it's just a meaningless resource in the EXE, no different from any other RC data. A manifest tells the OS several things. One thing it tells is which versions of DLLs to use with the associated program. The manifest that XPMan links to your program is one that tells the OS to use version 6 of the common-control library. Programs without that instruction are linked with version 5.x instead. It's only version 6 that has controls with themed painting, so that's why the XPMan unit enables themed painting for a program. A manifest can also tell the OS to use specific versions of _other_ DLLs. I don't know how, though. A manifest doesn't have to be linked as a resource. It can also reside in the application's directory in a file with a ".manifest" extension after the full name of the EXE. A reason to _not_ use XPMan is when you want to include other things in your program's manifest besides the desired common-control version. > A program using it under Vista may show loss of colors in > buttons/toolbars/dialog boxes and other problems. Removing XPman > from the source solves the problem for Vista, but doesn't offer the > XP look under XP. I assume it also doesn't offer the Vista look under Vista, either, right? Perhaps there's a right way to get theming support in Vista, instead of just giving up on anything that isn't Windows XP? > My solution is not the simplest, but it works reliably: > > Copy "sample.manifest" from the D7 source\vcl or source\win32\vcl > directory in later versions and change the name of the copy to > app.exe.manifest where app is the name of the exe file of your > application. It must be placed on the application directory where > the exe is installed, either by hand or with an installer. > > Remove XPman from the uses clause in any windows where you may have > dropped it and remove the XPman button from those windows. When the > application starts, it will hopefully find and use app.exe.manifest > as if XPman was still in the uses clause. > > Unfortunately, the exe also finds it under Vista, so the manifest > file must be erased when the application starts for the first time, > or if you have an installer which can run a dll, you can erase it > after the installer copies it if you don't detect XP as the OS or not > copy it in the first place if your installer recognizes the operating > system before the file copy phase. > > Detecting XP needs only an API call to GetOSVersionEx to place its > result in a local variable: > > var OS: TOSVersionInfo, > > OS := GetVersionInfoEx; I think you mean GetVersionEx. > and check to see if OS.dwMajorVersion = 5, and OS.MinorVersion is 1 > for XP 32 bit, or 2 for XP 64bit. Note that those version numbers are already fetched in global variables in the SysUtils unit. No need to call GetVersionEx. > Unhappily, this technique does not detect the difference between > Vista x32 and x64, where both give 6.0 as a result. Does it have to? You're only looking to know when to delete the manifest file. Does the coloring only look wrong on one kind of processor and not the other? -- Rob _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

