用递归
 Form.Controls[i]
 if Form.Controls[i] is TWinControl then 递归

解决方案 »

  1.   

    var
      i: Integer;
    begin
      for i := 0 to Self.ComponentCount - 1 do
      begin
        ShowMessage(IntToStr(TWinControl(Self.Components[i]).Handle));
      end;
      

  2.   

    var  I: Integer;
      hd:hwnd;
    begin
      for I := Form1.ComponentCount - 1 downto 0 do
      begin
        if Form1.Components[i] is TWinControl then 
        hd:=TWinControl(Form1.Components[i]).Handle;
      end;end;
      

  3.   

    如下代码,并且可以判断是什么类型的控件
    For iLabelCount:=0 to self.ComponentCount-1 do
    begin
      if Self.Components[iLabelCount] is Tlabel then
    begin
    end else   if self.Components [iLabelCount] is TDbedit then
    begin
    end;
    end;