unit Un_Main;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,TypInfo,QActnList,QStdCtrls;type
  TForm1 = class(TForm)
    Label1: TLabel;
    lbClasses: TListBox;
    btnGetClasses: TButton;
    Label2: TLabel;
    lbClassInfo: TListBox;
    Label3: TLabel;
    lbProperty: TListBox;
    procedure lbClassesClick(Sender: TObject);
    procedure btnGetClassesClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    function CreateClass(const AClassName:string):TObject;
    procedure GetClassInfo(AClass:TObject;AStrings:TStrings);
    procedure GetClassAncestor(AClass:TObject;AStrings:TStrings);
    procedure GetClassProperty(AClass:TObject;AStrings:TStrings);
  end;var
  Form1: TForm1;implementation{$R *.dfm}procedure TForm1.lbClassesClick(Sender: TObject);
begin
with lbClasses.Items do begin
     clear;
     Add('TApplication');
     Add('TForm');
     Add('TButton');
     Add('TComponent');
     Add('TGraphicControl');
     Add('TListBox');
     Add('TComboBox');
     Add('TLabel');
     Add('TActionList');
 end;
     RegisterClasses([TApplication,TForm,TButton,TComponent,TgraphicControl,
     TlistBox,TComboBox,TLabel,TActionList]);
end;function TForm1.CreateClass(const AClassName:String):TObject;
var
   C:TFormClass;
   Obj:TObject;
begin
     C:=TFormClass(FindClass(AClassName));
     Obj:=C.Create(nil);
     Result:=Obj;
end;procedure TForm1.GetClassAncestor(AClass:TObject;AStrings:TStrings);
var
   AC:TClass;
begin
     AC:=AClass.ClassParent;
     AStrings.Add('Class Ancestry');
     while AC<>nil do
     begin
          AStrings.Add(Format('    %s',[AC.ClassName]));
          AC:=AC.ClassParent;
     end;
end;procedure TForm1.GetClassInfo(AClass:TObject;AStrings:TStrings);
var
   TI:PTypeInfo;
   TD:PTypeData;
   EnumName:String;
begin
     TI:=AClass.ClassInfo;
     TD:=GetTypeData(TI);
     with AStrings do
     begin
          Add(Format('Class Name:       %s',[TI.Name]));
          EnumName:=GetEnumname(TypeInfo(TTypeKind),Integer(TI.Kind));
          Add(Format('Kind:             %s',[EnumName]));
          Add(Format('Size:             %d',[AClass.InstanceSize]));
          Add(Format('Defined in:       %s.pas',[TD.Unitname]));
          Add(Format('Num Propetties:   %d',[TD.PropCount]));
      end;
end;procedure TForm1.GetClassProperty(AClass:TObject;AStrings:TStrings);
var
   PropList:PPropList;
   TI:PTypeInfo;
   TD:PTypeData;
   i:integer;
   NumProps:integer;
begin
     TI:=AClass.ClassInfo;
     TD:=GetTypeData(TI);     if TD.PropCount<>0 then
     begin
          GetMem(PropList,SizeOf(PPropInfo)*TD.PropCount);
          try
             GetPropInfos(AClass.ClassInfo,PropList);
             for i:=0 to TD.PropCount-1 do
                if not(PropList[i]^.PropType^.Kind=tkMethod)then
                   AStrings.Add(Format('%s:%s',[PropList[i]^.Name,
                   PropList[i]^.PropType^.Name]));
                   NumProps:=GetPropList(AClass.ClassInfo,[tkMethod],PropList);
                   if NumProps<>0 then
                   begin
                        AStrings.Add('');
                        AStrings.Add('------Events------');
                        AStrings.Add('');
                   end;
                   for i:=0 to Numprops-1 do
                      AStrings.Add(Format('%s:%s',[PropList[i]^.Name,
                      PropList[i]^.PropType^.Name]));          finally
                 FreeMem(PropList,SizeOf(PPropInfo)*TD.PropCount);
          end;
     end;
end;
procedure TForm1.btnGetClassesClick(Sender: TObject);
var
   Cls:TObject;
   ClassName:string;
begin
     lbClassInfo.Items.Clear;
     lbProperty.Items.Clear;     try
        ClassName:=lbClasses.Items[lbClasses.ItemIndex];
        Cls:=CreateClass(ClassName);
        try
           GetClassInfo(Cls,lbClassInfo.Items);
           GetClassAncestor(Cls,lbClassInfo.Items);
           GetClassProperty(Cls,lbProperty.Items);
        finally
           Cls.Free;
        end;
     except on E:EClassNotFound do
         showMessage('Class not Fount');
     end;
end;end.
这是源程式
请各位帮我分析一下这是怎么一回事