[TRUCOS DELPHI] Mostrar / Ocultar la Barra de Titulos.
delphi
//Ocultar procedure TForm1.HideTitlebar; var Style : longint; 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; //Mostrar procedure TForm1.ShowTitlebar; var Style : longint; 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 or ws_Caption or ws_border); bsDialog: SetWindowLong(Handle, gwl_Style, Style or ws_Caption or ds_modalframe or ws_dlgframe); end; Height := Height + getSystemMetrics(sm_cyCaption); Refresh; end; end;
Saludos!