处理WM_NCPaint消息<br><br>private<br> { Private declarations }<br> procedure WMNCPAint(var Mes : TWMNCPaint); message WM_NCPAINT;<br><br>procedure TForm1.WMNCPaint(var Mes : TWMNCPaint);<br>var<br> ACanvas : TCanvas;<br>begin<br> ACanvas := TCanvas.Create;<br> try<br> ACanvas.Handle := GetWindowDC(Form1.Handle);<br> with ACanvas do begin<br> Brush.Color := clActiveCaption;<br> Font.Name := 'Times New Roman';<br> Font.Size := 10;<br> Font.Color := clCaptionText;<br> Font.Style := [fsItalic, fsBold];<br> TextOut(GetSystemMetrics(SM_CYMENU) + GetSystemMetrics(SM_CXBORDER),<br> Round((GetSystemMetrics(SM_CYCAPTION) - Abs(Font.Height))/2) +1,<br> ' Your title here!');<br> end;<br> finally<br> ReleaseDC(Form1.Handle, ACanvas.Handle);<br> ACanvas.Free;<br> end;<br>end;