Chúng tôi bao gồm tài nguyên tệp kê khai của riêng mình vì, theo như tôi biết, Delphi không bao gồm các phần bổ sung mới cho Windows 7 (và Vista?). Với sự giúp đỡ từ http://msdn.microsoft.com/en-us/library/dd371711(VS.85).aspx và here và here:
Tạo một file "mymanifest.rc" với dòng đơn
1 24 "my.manifest"
và tạo ra một tập tin như dưới đây gọi 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>
Sau đó, thêm mymanifest.rc vào dự án của bạn và tắt tùy chọn 'enable runtime themes' vì điều này cũng tương tự (nhưng ít linh hoạt hơn). Phần 'requestedExecutionLevel' có thể được thay đổi để phù hợp với nhu cầu UAC của ứng dụng.
Làm việc cho chúng tôi.
Bạn đã bật chủ đề thời gian chạy trong Project/Options/Application chưa? – frogb
Cảm ơn - đó là những gì tôi đang tìm kiếm! –