Returns information about the current key. type
TRegKeyInfo = record NumSubKeys: Integer;
MaxSubKeyLen: Integer;
NumValues: Integer;
MaxValueLen: Integer;
MaxDataLen: Integer;
FileTime: TFileTime; end;function GetKeyInfo(var Value: TRegKeyInfo): Boolean;DescriptionCall GetKeyInfo to return all information about the current key to an application. Value is a variable declared in an application to store the key information returned by this function. Value must be of type TRegKeyInfo. Information returned by GetKeyInfo about the current key includes:Number of subkeys
Longest subkey name length, in characters
Number of data values
Longest data-value name length
Longest data-value length
Time of last write to the keyOn success GetKeyInfo returns True. On failure it returns False, and the Value record is set to zeroes.
TRegKeyInfo = record NumSubKeys: Integer;
MaxSubKeyLen: Integer;
NumValues: Integer;
MaxValueLen: Integer;
MaxDataLen: Integer;
FileTime: TFileTime; end;function GetKeyInfo(var Value: TRegKeyInfo): Boolean;DescriptionCall GetKeyInfo to return all information about the current key to an application. Value is a variable declared in an application to store the key information returned by this function. Value must be of type TRegKeyInfo. Information returned by GetKeyInfo about the current key includes:Number of subkeys
Longest subkey name length, in characters
Number of data values
Longest data-value name length
Longest data-value length
Time of last write to the keyOn success GetKeyInfo returns True. On failure it returns False, and the Value record is set to zeroes.
解决方案 »
- DBGrid一个格子输入内容正确时旁边的格子马上显示其对应内容如何实现
- 为什么Active Form在本机可以显示,在别的机器就无法显示????
- 这个问题并不容易,不信你们去做一个试试
- 请问如何根据实际需要生成一定数量的控件???
- 怎么得到数据库里面最近的一条记录?
- 请问编程高手:安装程序中 ini文件是如何写成的,注册又是如何写成的??? 谢谢那位热心朋友耐心给我讲解好么?
- 菜鸟问题4
- FastReport 2.45的Password?
- 请求帮助
- 请问在Adoquery控件中Sql语句使用日期型参数??
- 请问在DBgrid中,如何让总计这一条记录始终位于表格可视区的最后一行。
- ADOQUERY的SQL语句为什么时好时坏?
以上三个函数配合使用,将可以满足你的要求
var
Reg: TRegistry;
begin
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_CURRENT_USER;
if Reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\RunOnce', True) then
begin
Reg.WriteString('MyApp','"' + ParamStr(0) + '"');
Reg.CloseKey;
end;
finally
Reg.Free;
inherited;
end;end;
var
Reg: TRegistry;
Val:TStringList;
I:Integer;
begin
Reg:=TRegistry.Create;
try
Val:=TStringList.Create;
try
Reg.RootKey:=HKey_Local_Machine;
if not Reg.OpenKey(Edit1.Text,False) then
ShowMessage('Error opening key')
else
begin
Reg.GetValueNames(Val); for I:=0 to Val.Count-1 do
begin
ShowMessage(Edit1.Text + Chr(13) +
'has an Entry Called '+Val.Strings[I]+Chr(13)+
'With a Value of '+Reg.ReadString(Val.Strings[I]));
end;
if MessageDlg('Ok to delete the key and lose all these values?'
,Mtinformation,[mbYes,mbNo],0)=mryes then
Reg.DeleteKey(Edit1.Text); end;
finally
Val.Free;
end;
finally
Reg.Free;
end;
end;
别人写的,那里骗点分