HELP上说用OPENKEY,那个KEY设为NIL就可以了,怎么才是NIL呢?
''? #0?

解决方案 »

  1.   

    Call OpenKey to make a specified key the current key. Key is the name of the key to open. If Key is nil, the CurrentKey property is set to the key specified by the RootKey property.
    怎么把STRING设为NIL?????
      

  2.   

    procedure TForm1.FormCreate(Sender: TObject);
    var
    keys:tstrings;
    I:integer;
    tempnode:ttreenode;
    key:string;
    begin
    keys:=tstringlist.create;
    reg:=TRegistry.Create ;
    tvkeys.Font:=screen.MenuFont ;
    lvvalues.Font :=screen.MenuFont ;reg.lazywrite:=false;
    reg.RootKey :=HKEY_CLASSES_ROOT;
    if reg.OpenKey( 'msjava',true)=false then
    showmessage('Open key failed!');
    //showmessage(inttostr(reg.Currentkey) );reg.GetKeyNames(keys);
    node_classroot:=tvkeys.TopItem.Item[0];
    for i:=0 to keys.Count-1 do
    begin
     tempnode:=tvkeys.Items.AddChild(node_classroot,keys.strings[i]);
     //tempnode.Text :=keys.Strings[i];
     tempnode.ImageIndex:=1;
     tempnode.SelectedIndex:=2;
    // tvkeys.Items.add
     caption:='asdfsdf'+#33;
    end;
    tvkeys.Fullexpand ;
    end;REG 是个TREGISTRY