Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Resizeable window without title bar

Posted on 1999-06-29
6
Medium Priority
?
421 Views
Last Modified: 2010-04-06
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)
0
Comment
Question by:kotik
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 2

Author Comment

by:kotik
ID: 1385241
I tried to handle WM_SIZE and WM_SIZING messages, but it works only of the new size is less then the old.
I use a form with a BorderStyle = bsNone and an inherited StatusBar with overriden CreateParams proc:

procedure TFlatStatusBar.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  Params.Style := Params.Style or SBARS_SIZEGRIP;
end;
0
 
LVL 3

Expert Comment

by:Slavak
ID: 1385242
Handle WM_HITTEST message, and if cursor in place you want just return htBottomLeft.

0
 
LVL 2

Author Comment

by:kotik
ID: 1385243
Slavak!
How it can help me to resize the StatusBar's parent window?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Expert Comment

by:PROGRAMMING030999
ID: 1385244
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_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;

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;

Regards Michael

0
 
LVL 2

Author Comment

by:kotik
ID: 1385245
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;

0
 

Accepted Solution

by:
PROGRAMMING030999 earned 200 total points
ID: 1385246
Thanks for the points.

You could also use, but it makes an RTE with the
TWebbrowser???

procedure TForm1.CreateParams(VAR Params: TCreateParams);
begin
  Inherited CreateParams(Params);
  WITH Params DO
    Style := (Style OR WS_POPUP) AND (NOT WS_DLGFRAME);
    {or... Style := Style + WS_POPUP - WS_DLGFRAME; which is the
     equivalent to the above statement}
 end;

seen on http://www.delumpa.com/tips/forms/forms2.htm

Michael
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question