procedure WriteRegKeyString(Param_RootKey: HKey;
Param_CurrentKey, Param_KeyItem, Param_KeyString: String);
var
MyRegistry: TRegistry;
begin
MyRegistry := TRegistry.Create;
with MyRegistry do
begin
RootKey := Param_RootKey;
if OpenKey(Param_CurrentKey, True) = True then
begin
try
WriteString(Param_KeyItem, Param_KeyString);
except
on E: Exception do
Messagebox(Application.Handle, PChar(E.Message), '错误', MB_ICONSTOP);
end;
CloseKey();
end else Messagebox(Application.Handle, '没有相关项', '错误', MB_ICONSTOP);
Free;
end;
end;
Function NewCreateKey(Param_RootKey: HKey;
Param_CurrentKey: String): Boolean;
var
MyRegistry: TRegistry;
begin
MyRegistry := TRegistry.Create;
MyRegistry.RootKey := Param_RootKey;
Result := MyRegistry.CreateKey(Param_CurrentKey);
MyRegistry.Free;
end;
评论3
最新资源