gpt4 book ai didi

Delphi 7 vista/windows 7 list

转载 作者:行者123 更新时间:2023-12-03 14:36:13 24 4
gpt4 key购买 nike

是否有人有 Delphi 7 的 list 文件示例,该文件允许应用程序在 Windows XP/Vista/7 上以管理员身份运行?

运行具有此功能的应用程序通常会导致User Account Control (UAC)请求特权的对话框。

最佳答案

步骤如下:

<强>1。删除 XPMan: 删除项目中对 XPMan 组件的任何引用。 XPMan 将默认 list 添加到可执行文件中,以防止 Windows 查看我们的自定义 list 。您不必担心 XPMan 提供的 XP 主题,主题支持保留在以下 list 中。

<强>2。创建自定义 list :在项目目录中创建一个类似 Win7UAC.manifest 的文件(文件名实际上并不重要)。将以下行添加到 Win7UAC.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="App" 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>

您可以向此 list 添加更多项目。您还可以删除 Microsoft.Windows.Common-Controls 部分以禁用主题支持。

<强>3。将 list 编译为资源:在项目目录中创建一个名为 Win7UAC.rc 的文件,其中包含一行:

1 24 "Win7UAC.manifest"

要编译此文件,请转到cmd,指向项目目录并运行以下命令:

brcc32.exe Win7UAC.rc

<强>4。将资源( list )添加到项目中:只需在项目的单元文件之一中的任意位置添加以下行:

{$R 'Win7UAC.res'}

添加此行的合适位置是在项目主文件(通常名为 Project1.dpr)中的 {$R *.res} 行下。

<强>5。重建项目

<强>6。请记住,每当您将 XPMan 组件添加到任何项目单元时,此 UAC list 都将无法正常工作。

关于Delphi 7 vista/windows 7 list ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4757533/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com