Solved

enlarging app screen to "full-screen"

Posted on 2002-04-21
10
334 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
Industry Leaders: 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

738 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