Solved

Minimizing forms without borders

Posted on 1998-11-30
4
524 Views
Last Modified: 2010-04-04
I have a form which has BorderStyle set to bsNone. When I call Minimize it minimizes to a little rectangle just above the start button. How do I make it minimize like normal forms? Is it perhaps some other property which is involved?
0
Comment
Question by:red_2
4 Comments
 
LVL 4

Expert Comment

by:erajoj
ID: 1348611
Tried Application.Restore - Application.Minimize ?

/// John
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1348612
Please try the following:

type
  TForm1 = class(TForm)
  private
    { Private-Deklarationen }
    procedure SysCommand     (var Message: TWMSYSCOMMAND);        message WM_SYSCOMMAND;
  end;


procedure TForm1.SysCommand(var Message: TWMSYSCOMMAND);
begin
  if Message.CmdType and $FFF0 = SC_MINIMIZE then begin
    ShowWindow(handle,SW_MINIMIZE);
  end else inherited;
end;

Don't know if it works. Haven't tested it. Just a try...

Regards, Madshi.
0
 

Expert Comment

by:elkiors
ID: 1348613
Surely only the Application.Mainform will minimize to the taskbar, all other forms are subforms that will only sit 'above' the status bar ie within the desktop area.

Darren

0
 
LVL 3

Accepted Solution

by:
williams2 earned 200 total points
ID: 1348614
This is the way Windows should normally be dealing with it. Try:

  WindowState:= wsMinimized;
  ShowWindow(Handle,SW_HIDE);

But the one you want is this:

  Application.Minimize;
  ShowWindow(Handle,SW_HIDE);


Try it with a button on a form with BorderStyle = bsNone.

/Williams
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 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