Hi Guys,

I am trying to setup a routine to read into a TMemo the subkeys 
belonging to registry keys, and I keep getting a message 
saying: "Control '' has no parent window", which is not true to my 
knowledge. Here is how I approached the problem:

procedure ListSubkeys(Key:string; aMemo:TMemo);
var BaseKey: String;
aList:TMemo;
begin
    if key = '' then
    exit;

    Basekey := '\Software\MyApplication\'+key;
    aList:=TMemo.Create(Application);
    aList.Visible:=false;
    aList.Parent:=Application.MainForm;

    with TRegIniFile.Create do
    begin
        try
            rootKey:=HKey_Local_Machine;
            if not OpenKey(basekey,false) then
            exit;
            GetKeyNames(aList.Lines);
            aMemo.Text:=aList.Text;
        finally
            aList.Free;
            Free;
        end;
    end;
end;

Anyway I turn this code I get the error message. Can somebody point 
out what it is I am doing wrong here, please. Thanks in advance.

Emmanuel


Reply via email to