Доброе времени суток! Мне необходимо записать в реестр бинарное значение виде 00 00 32 45 00 00 32, без TRegistry, но у меня не как не получается вот код:
Код:
function RegWriteBinary(RootKey: HKEY; Key, Name:string; Value: string): Boolean;
var
Handle: HKEY;
Res: LongInt;
begin
Result := False;
Res := RegCreateKeyEx(RootKey, PChar(Key), 0, nil, REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS, nil, Handle, nil);
if Res <> ERROR_SUCCESS then
Exit;
Res :=RegSetValueEx(Handle, PChar(Name), 0, REG_BINARY, @Value, 20);
Result := Res = ERROR_SUCCESS;
RegCloseKey(Handle);
end;
Админ: Пользуемся тегами для оформления кода!
Помогите пожалуйста!