Hide the titlebar

Hide the titlebar.

Procedure TForm1.HideTitlebar;
var
Save : LongInt;
Begin
If BorderStyle=bsNone then Exit;
Save:=GetWindowLong(Handle,gwl_Style);
If (Save and ws_Caption)=ws_Caption then Begin
Case BorderStyle of
bsSingle,
bsSizeable : SetWindowLong(Handle,gwl_Style,Save and
(Not(ws_Caption)) or ws_border);
bsDialog : SetWindowLong(Handle,gwl_Style,Save and
(Not(ws_Caption)) or ds_modalframe or ws_dlgframe);
End;
Height:=Height-getSystemMetrics(sm_cyCaption);
Refresh;
End;
end;
And here is how we show it again:
Procedure TForm1.ShowTitlebar;
Var
Save : LongInt;
begin
If BorderStyle=bsNone then Exit;
Save:=GetWindowLong(Handle,gwl_Style);
If (Save and ws_Caption)<>ws_Caption then Begin
Case BorderStyle of
bsSingle,
bsSizeable : SetWindowLong(Handle,gwl_Style,Save or
ws_Caption or ws_border);
bsDialog : SetWindowLong(Handle,gwl_Style,Save or
ws_Caption or ds_modalframe or ws_dlgframe);
End;
Height:=Height+getSystemMetrics(sm_cyCaption);
Refresh;
End;
end;

Incoming search terms:

  • Delphi hide titlebar
  • delphi tchart hidtitlebar
This entry was posted in Forms, Windows API. Bookmark the permalink.

One Response to Hide the titlebar

  1. azis says:

    nice tutorial..!
    hallo mr…!please help me iam newbie..!
    1.how so my application cannot close with push alt+F4…?
    2.if iam push keyboard how so start menu not actip (disable)..?
    iam sorry my englis is bad…please help me..
    i will back…!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please copy the string cLOWeK to the field below: