Newsgroups : Borland : borland.public.delphi.rtl.win32 : 2006 Dec : FIXED: Vista + XP manifest and disappearing controls on ALT key

www.cryer.info
Managed Newsgroup Archive

FIXED: Vista + XP manifest and disappearing controls on ALT key

Subject:FIXED: Vista + XP manifest and disappearing controls on ALT key
Posted by:"Aleksander Oven" (aleksander.ov..@email.si)
Date:Sat, 9 Dec 2006 23:04:21

Hi, everyone!

While playing with UAC manifest I discovered that Delphi apps which include
a custom-compiled XP manifest no longer exhibit the problem of disappearing
TButtonControl descendants on Vista.

I'm not sure what exactly, but there seems to be something wrong with the
default WindowsXP.res that comes with Delphi.

Below are the two manifests, plain XP and hybrid XP+UAC (if you're developing
for Vista), and the corresponding RC files I used to compile them.

To fix your apps, you only need to compile one of the RC files with brcc32.exe
and replace Delphi's WindowsXP.res with the new one. Which one you use will
depend on whether you want your apps to be Vista UAC aware or not.

NOTE: Make sure you save the manifests as UTF-8 files!

Regards,
Aleksander Oven

---------------------------------XP.manifest------------------------------------
<?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="*"
    name="ThemeAwareApplication"
    type="win32"/>
  <dependency>
    <dependentAssembly>
     <assemblyIdentity
       type="win32"
       name="Microsoft.Windows.Common-Controls"
       version="6.0.0.0"
       processorArchitecture="*"
       publicKeyToken="6595b64144ccf1df"
       language="*"/>
    </dependentAssembly>
  </dependency>
</assembly>
----------------------------XP+UAC.manifest----------------------------------
<?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="*"
    name="UACAwareApplication"
    type="win32"/>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity
        type="win32"
        name="Microsoft.Windows.Common-Controls"
        version="6.0.0.0"
        processorArchitecture="*"
        publicKeyToken="6595b64144ccf1df"
        language="*"/>
    </dependentAssembly>
  </dependency>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level="asInvoker"/>
      </requestedPrivileges>
    </security>
  </trustInfo>
</assembly>
------------------------------------XP.rc---------------------------------------
XP_MANIFEST RCDATA ".\XP.manifest"
----------------------------------XP+UAC.rc----------------------------------
XP_UAC_MANIFEST RCDATA ".\XP+UAC.manifest"
---------------------------------------------------------------------------------

Replies:

www.cryer.info
Managed Newsgroup Archive