Eugie » 23 фев 2005, 20:33
Код: Выделить всё
function MyReg_SetString(pRoot: HKEY; pKey, pValue, pStr: String): Boolean;
var hk: HKEY;
dispos: Dword;
begin
Result := False;
try
if Win32Check(ERROR_SUCCESS = RegCreateKeyEx(pRoot, PChar(pKey), 0, nil,
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, nil, hk, @dispos)) then
Win32Check(ERROR_SUCCESS = RegSetValueEx(hk, pChar(pValue), 0, REG_SZ,
PChar(pStr), Length(pStr)+1));
Result := True;
finally
RegCloseKey(hk);
end;
end;
...
...
MyReg_SetString(HKEY_LOCAL_MACHINE, 'SOFTWARE\Mirabilis\ICQ\ICQLite', 'megautil', 'stro4ka');
[code]
function MyReg_SetString(pRoot: HKEY; pKey, pValue, pStr: String): Boolean;
var hk: HKEY;
dispos: Dword;
begin
Result := False;
try
if Win32Check(ERROR_SUCCESS = RegCreateKeyEx(pRoot, PChar(pKey), 0, nil,
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, nil, hk, @dispos)) then
Win32Check(ERROR_SUCCESS = RegSetValueEx(hk, pChar(pValue), 0, REG_SZ,
PChar(pStr), Length(pStr)+1));
Result := True;
finally
RegCloseKey(hk);
end;
end;
...
...
MyReg_SetString(HKEY_LOCAL_MACHINE, 'SOFTWARE\Mirabilis\ICQ\ICQLite', 'megautil', 'stro4ka');
[/code]