unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,Registry;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
Procedure TForm1.Button1Click(Sender:TObject);
var reg:TRegistry;
d
WORD;
Begin
d:=111;//你把111改成222试一下?呵呵.......十进制的!
reg:=TRegistry.create;
reg.RootKey:= HKEY_LOCAL_MACHINE;
if (reg.OpenKey('SOFTWARE/SachowWorks',true)) Then
begin
reg.WriteInteger('TestDWORD', d);
reg.CloseKey;
end;
reg.free;
End;
end.
测试通过,可写入Dword值, QQ:108438328