Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi - Windows Aero resources

Tags:

delphi

aero

Anyone have any good resources for Delphi and Windows Aero on 7 or Vista?

We're just about to add Windows 7 to our company and want to make sure that our in-house applications use fit in as well as possible.

Using Delphi 2010 I can add the Glass Frame and the menu bar inherits an Aero look, however the TabControls, Grids and Status bars all stick out as being outdated.

Any help?

like image 278
Dan Kelly Avatar asked Nov 17 '09 13:11

Dan Kelly


2 Answers

We include our own manifest resource because, as far as I am aware, Delphi doesn't include the new manifest additions for Windows 7 (and Vista?). With help from http://msdn.microsoft.com/en-us/library/dd371711(VS.85).aspx and here and here:

Create a file "mymanifest.rc" with the single line

1 24 "my.manifest"

and create a file as below called my.manifest

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <assemblyIdentity type="win32" name="OUR COMPANY NAME" version="3.1.0.0" processorArchitecture="*"/>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="*"/>
    </dependentAssembly>
  </dependency>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
        </requestedPrivileges>
    </security>
  </trustInfo>
  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
    <application>
      <!--The ID below indicates application support for Windows Vista -->
      <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
      <!--The ID below indicates application support for Windows 7 -->
      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
    </application>
  </compatibility>
</assembly>

Then add the mymanifest.rc to your project and turn off the 'enable runtime themes' option as this does the same thing (but less flexible). The 'requestedExecutionLevel' section can be altered to suit the UAC needs of the app.

Works for us.

like image 61
shunty Avatar answered Oct 10 '22 13:10

shunty


I agree that using the Enable Runtime Themes project option should make most controls theme-aware.

TMS Components are always being updated to include the latest themes, including Windows 7, and Raize Components allow you to make use of transparency, gradients and theme-aware colours.

like image 35
J__ Avatar answered Oct 10 '22 15:10

J__