修改标题栏高度

{修改系统标题栏高度,所有窗口都会改变}

var

  ncm: TNonClientMetrics;

begin

  ncm.cbSize := sizeof(TNonClientMetrics);

  SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(TNonClientMetrics), @ncm, 0);

  ncm.iCaptionHeight := 25;

  SystemParametersInfo(SPI_SETNONCLIENTMETRICS, sizeof(TNonClientMetrics), @ncm, 0);

end;



{通过消息控制修改,当前窗体}

Procedure WMNCalcSize(var Msg: TWMNCCalcSize);

begin

  Msg.CalcSize_Params^.rgrc[0].Top := Msg.CalcSize_Params^.rgrc[0].Top + 35;

  inherited;

end;



{隐藏标题栏,保留窗体3D边框}

begin

  SetWindowLong(Self.Handle, GWL_STYLE, GetWindowLong(Self.Handle, GWL_STYLE) and not WS_CAPTION);

  Height := ClientHeight;

{隐藏系统菜单}

  SetWindowLong(Self.Handle, GWL_STYLE, GetWindowLong(Self.Handle, GWL_STYLE) and not WS_SYSMENU);



end;

 

你可能感兴趣的:(修改)