试试这个吧:
procedure WMNCActivate(var Mes : TWMNCActivate);
message WM_NCACTIVATE;
.....
procedure TForm1.WMNCActivate(var Mes : TWMNCActivate);
begin
mes.Active:=True;
inherited;
end;
如果你要自己画的话,就再加入这个:
procedure WMNCPAint(var Mes : TWMNCPaint);
message WM_NCPAINT;
procedure Paint_Caption;
procedure TForm1.WMNCPAint(var Mes : TWMNCPaint);
begin
inherited;
Paint_Caption;
end;
procedure TForm1.Paint_Caption;
var
ACanvas : TCanvas;
begin
ACanvas := TCanvas.Create;
try
ACanvas.Handle := GetWindowDC(Form1.Handle);
with ACanvas do
begin
//在这里加入你想画标题栏的代码
end;
finally
ReleaseDC(Form1.Handle, ACanvas.Handle);
ACanvas.Free;
end;
end;