kotik
asked on
Resizeable window without title bar
How can I create a window without the title bar, but with a sizing grip in right-bottom corner or a status bar?
(As in IE 5.0)
(As in IE 5.0)
Handle WM_HITTEST message, and if cursor in place you want just return htBottomLeft.
ASKER
Slavak!
How it can help me to resize the StatusBar's parent window?
How it can help me to resize the StatusBar's parent window?
Hi kotik,
for hiding the Caption you could use:
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_S tyle,Save and
(Not(ws_Caption)) or ws_border);
bsDialog : SetWindowLong(Handle,gwl_S tyle,Save and
(Not(ws_Caption)) or ds_modalframe or ws_dlgframe);
End;
Height:=Height-getSystemMe trics(sm_c yCaption);
Refresh;
End;
end;
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_S tyle,Save or ws_Caption or
ws_border);
bsDialog : SetWindowLong(Handle,gwl_S tyle,Save or ws_Caption or
ds_modalframe or ws_dlgframe);
End;
Height:=Height+getSystemMe trics(sm_c yCaption);
Refresh;
End;
end;
Regards Michael
for hiding the Caption you could use:
Procedure TForm1.HideTitlebar;
Var
Save : LongInt;
Begin
If BorderStyle=bsNone then Exit;
Save:=GetWindowLong(Handle
If (Save and ws_Caption)=ws_Caption then Begin
Case BorderStyle of
bsSingle,
bsSizeable : SetWindowLong(Handle,gwl_S
(Not(ws_Caption)) or ws_border);
bsDialog : SetWindowLong(Handle,gwl_S
(Not(ws_Caption)) or ds_modalframe or ws_dlgframe);
End;
Height:=Height-getSystemMe
Refresh;
End;
end;
Procedure TForm1.ShowTitlebar;
Var
Save : LongInt;
begin
If BorderStyle=bsNone then Exit;
Save:=GetWindowLong(Handle
If (Save and ws_Caption)<>ws_Caption then Begin
Case BorderStyle of
bsSingle,
bsSizeable : SetWindowLong(Handle,gwl_S
ws_border);
bsDialog : SetWindowLong(Handle,gwl_S
ds_modalframe or ws_dlgframe);
End;
Height:=Height+getSystemMe
Refresh;
End;
end;
Regards Michael
ASKER
Hi, Michael!
That helped me, so you can get points.
I only don't understand why this code don't work:
procedure TTblEditForm.CreateParams( var Params: TCreateParams);
begin
inherited CreateParams(Params);
Params.Style := Params.Style and not (WS_CAPTION) or WS_BORDER;
end;
That helped me, so you can get points.
I only don't understand why this code don't work:
procedure TTblEditForm.CreateParams(
begin
inherited CreateParams(Params);
Params.Style := Params.Style and not (WS_CAPTION) or WS_BORDER;
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I use a form with a BorderStyle = bsNone and an inherited StatusBar with overriden CreateParams proc:
procedure TFlatStatusBar.CreateParam
begin
inherited CreateParams(Params);
Params.Style := Params.Style or SBARS_SIZEGRIP;
end;