unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ComCtrls, ImgList, ToolWin, ExtCtrls, StdCtrls, Menus;

type
  TForm1 = class(TForm)
    ControlBar1: TControlBar;
    ToolBar1: TToolBar;
    ImageList1: TImageList;
    ToolButton1: TToolButton;
    ToolButton2: TToolButton;
    ToolButton3: TToolButton;
    ToolButton4: TToolButton;
    Button1: TButton;
    ToolBar2: TToolBar;
    ToolButton5: TToolButton;
    ToolButton6: TToolButton;
    MainMenu1: TMainMenu;
    N1111: TMenuItem;
    File1: TMenuItem;
    New1: TMenuItem;
    Open1: TMenuItem;
    Edit1: TMenuItem;
    Copy1: TMenuItem;
    Paste1: TMenuItem;
    procedure FormShow(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormShow(Sender: TObject);
begin
 ToolBar1.ManualDock(nil,nil,alNone);
 ToolBar1.ManualFloat(Bounds(100, 500, ToolBar1.UndockWidth, ToolBar1.UndockHeight));
end;

procedure TForm1.Button1Click(Sender: TObject);
var
 r:TRect;
begin
 if ToolBar1.HostDockSite<>ControlBar1 then
  begin
   GetWindowRect(ToolBar1.Handle, R);
   Application.MessageBox(PChar(IntToStr(r.Left)+'--'+IntToStr(r.Top)),'MM',IDOK);
  end;
end;

end.
