Einzelnen Beitrag anzeigen

alpha1

Registriert seit: 19. Nov 2005
40 Beiträge
 
#5

Re: How to write in registry hex key?

  Alt 19. Nov 2005, 21:40
Delphi-Quellcode:
program Test;

{$APPTYPE CONSOLE}

uses
  SysUtils,
  Registry,
  Windows;

var
  Reg : TRegistry;
  buf: array[0..3] of byte;

begin
  buf[0] := $01;
  buf[1] := $00;
  buf[2] := $00;
  buf[3] := $00;

  Reg:=TRegistry.Create;
  Reg.RootKey:=HKEY_LOCAL_MACHINE;
  Reg.OpenKey('SYSTEM', False);
  Reg.CreateKey('Parameters');
  Reg.OpenKey('Parameters', False);
  Reg.WriteBinaryData('Test', @buf, 4);
  Reg.CloseKey;
  Reg.Free;
end.
Here is an error: [Error] Project1.dpr(25): Constant object cannot be passed as var parameter
  Mit Zitat antworten Zitat