unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, WindowTitlebarUnit, RectPointUnit, uses_end; type TForm1 = class(TForm) Timer1: TTimer; procedure Timer1Timer(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); begin Self.BorderStyle := bsNone; Self.FormStyle := fsStayOnTop; end; procedure TForm1.FormClick(Sender: TObject); begin Self.Close; end; procedure TForm1.Timer1Timer(Sender: TObject); var TitleInfo: TTitleBarInfomation; R: TRect; begin TitleInfo := TTitleBarInfomation.Create(GetForegroundWindow); try // Self.BoundsRect := TitleInfo.TitleBarRect; // Self.BoundsRect := TitleInfo.TitleBarFullRect; R := TitleInfo.TitleBarRect; Self.Top := R.Top; Self.Left := R.Left; Self.Width := GetRectWidth(R); finally TitleInfo.Free; end; end; end.