Solved

enlarging app screen to "full-screen"

Posted on 2002-04-21
10
335 Views
Last Modified: 2010-04-04
Hi...
  I have my app currently designed to use about 75 percent of the full screen, while being positioned to the upper-left corner of the screen. I would like to make it full-screen so my file-list boxes have more room for users to view/select files.
   Is this as simple as stretching out my form (and components) during design-time to full screen? Will this account for different users using different screen resolutions? Or is there some "automatic self-adjusting" thing I must include that will adapt my app to the specific users' screen resolution, at run-time?

I am using D3 Professional

Thanks
   Shawn
0
Comment
Question by:aztec
[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
10 Comments
 
LVL 10

Accepted Solution

by:
viktornet earned 50 total points
ID: 6958401
Hi there,

I don't remember who I got this from, but whoever it was, God bless you!

--------------------

      Here is the simple solution (but it greats): All you need just to set the scale property from main
      form to TRUE and then add this to the oncreate event of the form, maybe like this:
      procedure Tform1.Create()
      begin
       PixelsPerInch := Getdevicecaps(handle, LOGPIXELSY);
       { your code...if any}
      end;

------------

-Viktor
0
 
LVL 3

Expert Comment

by:tongalite
ID: 6958452
listening
0
 
LVL 44

Expert Comment

by:bruintje
ID: 6958553
OT > Viktor you're back that's good 2 c

for aztec


found a little nugget on the net in another forum of course :)

{
  Make your application Full Screen.
  Disable all of the system keys.
}

procedure TForm1.FormCreate(Sender: TObject);
var
  HTaskbar: HWND;
  OldVal: LongInt;
begin
  try
    // Find handle of TASKBAR
    HTaskBar := FindWindow('Shell_TrayWnd', nil);
    // Turn SYSTEM KEYS off, Only Win 95/98/ME
    SystemParametersInfo(97, Word(True), @OldVal, 0);
    // Disable the taskbar
    EnableWindow(HTaskBar, False);
    // Hide the taskbar
    ShowWindow(HTaskbar, SW_HIDE);
  finally
    with Form1 do  
    begin
      BorderStyle := bsNone;
      FormStyle   := fsStayOnTop;
      Left        := 0;
      Top         := 0;
      Height      := Screen.Height;
      Width       := Screen.Width;
    end;
  end
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
var
  HTaskbar: HWND;
  OldVal: LongInt;
begin
  //Find handle of TASKBAR
  HTaskBar := FindWindow('Shell_TrayWnd', nil);
  //Turn SYSTEM KEYS Back ON, Only Win 95/98/ME
  SystemParametersInfo(97, Word(False), @OldVal, 0);
  //Enable the taskbar
  EnableWindow(HTaskBar, True);
  //Show the taskbar
  ShowWindow(HTaskbar, SW_SHOW);
end;

Maybe it helps
:O)Bruintje
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:aztec
ID: 6958694
Bruintje - how would your approach be different (or better) than Viktornet's approach? His appears to be much simpler.

Thanks
   Shawn
0
 
LVL 5

Expert Comment

by:Gwena
ID: 6958799
listening :-)
0
 
LVL 44

Expert Comment

by:bruintje
ID: 6958875
never said it would be better, take your pick and enjoy ;) just was looking for an execuse to make a comment
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6959351
hi friends, long time not seen, specially viktor
0
 
LVL 2

Expert Comment

by:gallaghe
ID: 6977199
The following is from an article I wrote for Delphi3000 web site.

Covering the entire screen with a form is relatively easy to accomplish as shown below.

procedure TfrmMainForm.FormCreate(Sender: TObject);
begin
  { Position form }
  Top := 0 ;
  Left := 0 ;

  { Go full screen }
  WindowState  := wsmaximized;
  ClientWidth  := Screen.Width ;
  ClientHeight := Screen.Height;
  Refresh;
end;

If this is a typical form it will have borders which you might consider removing by setting BorderStyle property to bsNone as shown below.

procedure TfrmMainForm.FormCreate(Sender: TObject);
begin
  { Position form }
  Top := 0 ;
  Left := 0 ;

  { Go full screen }
  BorderStyle := bsNone ;
  WindowState  := wsmaximized;
  ClientWidth  := Screen.Width ;
  ClientHeight := Screen.Height;
  Refresh;
end;

Sometimes the code shown above will go full screen but still display the Windows TaskBar, if this happens we can force the form on top using either SetForeGroundWindow or SetActiveWindow. From my testing it is best to use both if the problem persist.

procedure TfrmMainForm.FormCreate(Sender: TObject);
begin
  { Position form }
  Top := 0 ;
  Left := 0 ;

  { Go full screen }
  BorderStyle := bsNone ;
  WindowState  := wsmaximized;
  ClientWidth  := Screen.Width ;
  ClientHeight := Screen.Height;
  Refresh;
  SetForegroundWindow(Handle) ;
  SetActiveWindow(Application.Handle) ;
end;

Other  considerations (see attachment for code to address these items)
If the form is already in maximized window state the above code will not work.
Controlling the system menu commands as per above needs to be considered
Ghost items in the TaskBar after terminating your application.  

The link to the article with source code
http://www.delphi3000.com/articles/article_2863.asp
0
 

Author Comment

by:aztec
ID: 7009225
Works great! Thanks!

Shawn
0
 

Author Comment

by:aztec
ID: 7068490
Sorry, but I see now that this answer by Viktornet does not work. I have just bought a new computer and I tried my app on it and it does not show the full screen. Can we re-open this question?

Thanks
   Shawn

P.S: The computer I developed my app on has screen resolution of 800 X 600. My new one I just tried it on is 1024 X 768. I would like my app to be robust enough to adapt to all different screen sizes/resolutions and be always 'full-screen'.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses
Course of the Month11 days, 16 hours left to enroll

623 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