"Test Environment" Windows 7 flagship with Sp1,rad Seattle
1. text File: Uac.manifest
<?XML version= "1.0" encoding= "UTF-8" standalone= "yes"?><Assemblyxmlns= "Urn:schemas-microsoft-com:asm.v1"manifestversion= "1.0"><TrustInfoxmlns= "Urn:schemas-microsoft-com:asm.v3"><Security><requestedprivileges><requestedExecutionLevel Level= "Requireadministrator"uiAccess= "false"></requestedExecutionLevel></requestedprivileges></Security></TrustInfo><Dependency><dependentassembly><assemblyidentitytype= "Win32"name= "Microsoft.windows.common-controls"version= "6.0.0.0"processorarchitecture= "x86"PublicKeyToken= "6595B64144CCF1DF"language="*"></assemblyidentity></dependentassembly></Dependency></Assembly>
2. text file: uac.rc
1 Uac.manifest
3, copy the above two files to the RAD10 directory/bin (such as Embarcadero\studio\17.0\bin)
4. Compile this. rc file as a. res file with BRCC32
BRCC32 Uac.rc-fouac.res
5. Add {$R Uac.res} after {$R *.res} in the project document. DPR}
6, open the project properties, Application->manifest file, changed to custom, select the Uac.manifest file below, recompile the project.
Delphi Generation EXE automatically runs as Administrator