//應該明白了吧<br>function EnumFun(hWnd : Thandle; lParam : LongInt): BOOL; Stdcall;<br>var<br> ClassName : array[0..1024] of Char;<br> Control : TControl;<br>begin<br> GetClassName(hWnd, ClassName, 1024);<br> Control := FindControl(hWnd);<br> if Control is TToolBar then ShowMessage(Control.Name);<br> Result := True;//EnumChildWindows(hWnd, @EnumFun, lParam);<br>end;<br><br>procedure TForm1.Button2Click(Sender: TObject);<br>begin<br> EnumChildWindows(Handle, @EnumFun, 0);<br>end;