Rob Kennedy wrote: >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.
That's the most flexible method, I think. At least one can turn it off easily if need be, simply by deleting the file after the first run. However, the first run won't look right if the problems I've mentioned are present. So it's better either to not load it with the installer if it can detect Vista or to delete it from within an additional dll or an exe from the installer. >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? Vista puts it's own look on some things, not on others. I'd like to keep all my user interfaces looking as similar as possible regardless of the OS starting with NT4, but this is a hopeless battle with the windmills of MS. >Perhaps there's a right way to get theming support in Vista, instead of >just giving up on anything that isn't Windows XP? Perhaps a detailed search of MSDN might bring up something useful. I haven't done so. > > 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. Oops! Right. > > 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. D7 was published several years before XP x64 and of course before Vista x64. I haven't looked to see what SysUtils from D7 shows in these cases. Does anyone know what Delphi 2007 shows? I'm waiting for a 64 bit version before I spend any money on it. Using GetVersionEx gives better control in my view. > > 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? In this immediate case, it doesn't matter, but there are other reasons for wanting to know if the app is running under Vista x32 or Vista x64 or one of the compatibility modes. One reason is to warn users to setup a compatibility mode if there is integer typecasting of pointers in a third party dll without source code and physical memory is larger than 2GB. I hoped that IsWOW64Process would be helpful. Unfortunately concerning IsWOW64Process, MSDN warns: For compatibility with operating systems that do not support this function, call GetProcAddress to detect whether IsWow64Process is implemented in Kernel32.dll. If GetProcAddress succeeds, it is safe to call this function. Otherwise, WOW64 is not present. Note that this technique is not a reliable way to detect whether the operating system is a 64-bit version of Windows because the Kernel32.dll in current versions of 32-bit Windows also contains this function. Other alternatives, taken from MSDN x64 driver installation instructions include: 1 Check the value returned by UpdateDriverForPlugAndPlayDevices. If the return value is ERROR_IN_WOW64, the 32-bit application is executing on a 64-bit platform. 2 Call GetSystemWow64Directory. If GetSystemWow64Directory fails and GetLastError returns ERROR_CALL_NOT_IMPLEMENTED, the installer is running on 32-bit Windows. Neither seems to guarantee unique results. Any ideas will be appreciated. Irwin Scollar _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

