Author: Jonas Bilinkevicius Does anyone know how to write text with the TEXTOUT command in the title bar of a form in D5? Answer: You have to handle the WM_NCPAINT message. 1 { ... } 2 type 3 TForm1 = class(TForm) 4 private 5 procedure WMNCPaint(var Msg: TWMNCPaint); message WM_NCPAINT; 6 public 7 end; 8 9 var 10 Form1: TForm1; 11 12 implementation 13 14 {$R *.dfm} 15 16 procedure TForm1.WMNCPaint(var Msg: TWMNCPaint); 17 var 18 ACanvas: TCanvas; 19 begin 20 inherited; 21 ACanvas := TCanvas.Create; 22 try 23 ACanvas.Handle := GetWindowDC(Form1.Handle); 24 with ACanvas do 25 begin 26 Brush.Color := clActiveCaption; 27 Font.Name := 'Tahoma'; 28 Font.Size := 8; 29 Font.Color := clred; 30 Font.Style := [fsItalic, fsBold]; 31 TextOut(GetSystemMetrics(SM_CYMENU) + GetSystemMetrics(SM_CXBORDER), 32 Round((GetSystemMetrics(SM_CYCAPTION) - Abs(Font.Height)) / 2) + 1, 33 ' Some Text'); 34 end; 35 finally 36 ReleaseDC(Form1.Handle, ACanvas.Handle); 37 ACanvas.Free; 38 end; 39 end;