Reg.WriteBinaryData的参数是一个指针和一个长度
你可以这样:
var
l:integer;
p:pchar;
begin
p:='ForceActiveDesktopOn';
l:=length(p);
Reg.WriteBinaryData(p,l,sizeof(l));

解决方案 »

  1.   

    >>str1:=1;//integer;
    >>Reg.Writeinteger('ForceActiveDesktopOn',str1);
      

  2.   

    var
    str1 : dwordReg.WriteBinaryData('ForceActiveDesktopOn',str1,sizeof(str1));
      

  3.   

    str1:Dword可str怎样付植呢?
    str1=1吗?我试过好象还是不行!!
      

  4.   

    str1:='1';
    Reg.RootKey:=HKEY_CURRENT_USER;
    Reg.OpenKey('Software\Microsoft\Windows\CurrentVersion\Policies\Explorer',false);
    Reg.WriteBinaryData('ForceActiveDesktopOn',str1,sizeof(str1));Reg.CloseKey;
    Reg.Free;Systemparametersinfo(SPI_SETDESKWALLPAPER,0,nil,SPIf_SendChange);
    systemparametersinfo(SPI_SETDESKWALLPAPER ,0,pchar('c:\1.htm'),SPIF_UPDATEINIFILE );
    交换一下语句的顺序。还有就是不知道在你的user中是否有注册表单元