如下代码,并且可以判断是什么类型的控件
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;
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;