Delphi在Vasta/win 7下获取权限
毕竟Win32程序的开发,Delphi还是有顽强的生命力的。
操作步骤如下:
1.建立 res 文件
建立一个文本文件,名字可以自己起,我这里叫:UAC.manifest,内容:
<?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>
建立文本文件,名为 UAC.rc,内容:
1 24 UAC.manifest
编译成 uac.res 文件,运行:
brcc32 uac.rc -fouac.res
2.在代码中引入
打开项目文件,加入
{$R uac.res}
3.编译程序
这时程序就支持 VISTA 了,在运行的时候,会弹出 WINDOWS 的提示框,询问用户是否允许以管理员身份运行。
通过我自己实践,在Delphi7下面是可以的,但是在Delphi2009下面测试没有通过。
相关文档:
过程无返回值,函数有返回值。
procedure MyProc(m,n : Integer; o : String; p : Single = 2.5; q : String = 'Delphi');
如上例所示,过程声明和定义中,多个参数是用分号隔开的,但在调用时是用逗号隔开的 。eg:
......
Day 开头的函数
●
Unit
DateUtils
function DateOf(const Avalue: TDateTime): TDateTime;
描述
使用 DateOf 函数用来把一个 TDateTime 类型的变量转变成一个
只带有日期的 TDateTime 类型变量。
例如:
showmessage(DateTimetostr(dateof(now())));
你得到的是 2003/03/19
而 showmessage(Dat ......
bool是LongBool类型。
Delphi中定义了四种布尔类型:Boolean,ByteBool,WordBool和LongBool。后面三种布尔类型是为了与其他语言兼容而引入的,一般情况下建议使用Boolean类型。
这四种类型的布尔值占用内存的数量如下:
Boolean 1 Byte
ByteBool 1 Byte
WordBool 2 Bytes(1 Word)
LongBool 4 Bytes(2 Words)
对 ......
ExpressQuantumGrid.Suite.v6.30 在Delphi 7中的安装
大名鼎鼎的Grid控件,没有找到打好包的,以下是手动安装步骤
=====================
1、必须配套安装如下7组控件,已经安装过的则跳过
XP Theme Manager
ExpressGDI+ Library
ExpressLibrary
ExpressExport Library
ExpressDataController
ExpressEditors Lib ......