1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29:
| procedure TForm2.FormCreate(Sender: TObject); begin BorderStyle := bsSingle; HideTitlebar(Form2); end;
procedure HideTitlebar(Form: TForm); var Style: Longint; begin with Form do begin if BorderStyle = bsNone then Exit; Style := GetWindowLong(Handle, GWL_STYLE); if (Style and WS_CAPTION) = WS_CAPTION then begin case BorderStyle of bsSingle, bsSizeable: SetWindowLong(Handle, GWL_STYLE, Style and (not (WS_CAPTION)) or WS_BORDER); bsDialog: SetWindowLong(Handle, GWL_STYLE, Style and (not (WS_CAPTION)) or DS_MODALFRAME or WS_DLGFRAME); end; Height := Height - GetSystemMetrics(SM_CYCAPTION); Refresh; end; end; end; |