bdn.borland.com

Article #28301: How to make your main form fill up the Desk Top space.

QUESTION:

How do I make sure my main form occupies all of the desktop space when my application is run?

ANSWER:

Below is a code sample that demonstrates the process.

procedure TForm1.FormCreate(Sender: TObject);
var
   DeskTopForm: TRect;
begin

(* You'll find more options in the Win32.hlp file under SystemParametersInfo *)
   SystemParametersInfo(SPI_GETWORKAREA, 0, Pointer(@DeskTopForm), 0);

   Top := DeskTopForm.Top;
   Left := DeskTopForm.Left;
   Height := DeskTopForm.Bottom - DeskTopForm.Top + 1;
   Width := DeskTopForm.Right - DeskTopForm.Left + 1;
end;

Last Modified: 05-FEB-02