Vista provides a UAC mechanism that is one of the new features of Vista. Its primary purpose is to prevent malicious modifications to the operating system itself. If you want to make changes to Vista's system settings, you must pass the validation of UAC to be able to do so. By such means, the security of the system is greatly provided.
On the pros and cons of UAC, the network on the argument is mixed, here is not specifically discussed.
For the effect of Delphi program, UAC mainly lies in the following points:
1, due to the UAC mechanism, Delphi for the operation of the system may be silent failure, and the same program, under the 2000/x may run normally. For example, registry changes ...
2, in order to avoid such a situation, the Delphi program must support the Vista UAC callout, that is, the UAC program under the icon Display Shield logo. This allows users to be alerted when the system has higher privileges.
In order for the program to display the UAC flag, it now appears that Vista is using the manifest resource in the program's resources (Resource) to decide whether to display the UAC shield.
In order to support the VISTA,DELPHI program must embed manifest information inside the resource.
1, first edit a file, the contents are as follows:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Keep it as uac.manifest, the file here is random. Pay special attention to the red "requireadministrator", which requires an administrator to function properly.
2, and then edit an RC file, called Uac.rc
1 24 UAC.manifest
which
1-On behalf of the resource number
24-Resource type is Rtmainifest
uac.manifest-Previous file name
3. Compile this rc file as res file with BRCC32
BRCC32 uac.rc-fouac.res//Note: Brcc32.exe in Delphix\bin directory
4, in the program to join
{$R uac.res}
Let Delphi compile the time, the uac.res into EXE file
5, put the file into Vista run, you will see the program icon below the UAC Shield logo is shown