操作注册表

var
  Registry: TRegistry;
begin
  Registry:=TRegistry.Create;
  Registry.RootKey:=HKEY_LOCAL_MACHINE;
  Registry.OpenKey('\SOFTWARE\Microsoft\Windows\CurrentVersion',False);
  Registry.RootKey:=HKEY_LOCAL_MACHINE;
  Registry.OpenKey('\SOFTWARE\CCCCC',True);

  if not Registry.ValueExists('refreshtime') then
  begin
     Registry.CreateKey('refreshtime');
     Registry.WriteString('refreshtime','200');
  end;
  globerefreshtime:=Registry.readString('refreshtime');

  if not Registry.ValueExists('FCanPrint') then   
      Registry.WriteBool('FCanPrint',true);
  FCanPrint:=Registry.ReadBool('FCanPrint');

  if not Registry.ValueExists('PrintNum') then  
      Registry.WriteInteger('PrintNum',1);
  PrintNum:=Registry.ReadInteger('PrintNum');

 

posted @ 2012-03-27 11:08  ftwsnow  阅读(188)  评论(0)    收藏  举报