Delphi Program's support for Windows Vista

Source: Internet
Author: User

I have been programming in Windows XP/2003 before. Now some customers use the Vista system to runProgramAn error is reported. My program uses the registry and reads and writes to HKLM. The security mechanism of Vista is definitely not allowed. When other software encounters this problem, there is a Windows security prompt, ask if my program runs as an administrator. If no prompt is displayed, an error is reported. Later, I found the solution on the Internet, so that my program also supports Vista.

Procedure:

1. Create a res File

Create a text file named by yourself. Here is UAC. manifest. content:

<? 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 =  "Requireadministrator" /> </Requestedprivileges> </Security> </trustinfo> </Assembly>

Create a text file named UAC. Rc. content:

 
1 24 UAC. manifest

Compile it into the UAC. Res file and run:

Brcc32 UAC. RC-fouac. Res

2. InCodeIntroduced in
Open the project file and add

 
{$ R uac. Res}

3. Compile the program

In this case, the program supports Vista. When running, a Windows Prompt box is displayed asking you if you are allowed to run as an administrator.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.