Solved

Re-opening of question "Enlarging app to full-screen" from before

Posted on 2002-06-10
20
189 Views
Last Modified: 2010-04-04
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
Comment
Question by:aztec
  • 8
  • 7
  • 3
  • +1
20 Comments
 
LVL 2

Expert Comment

by:freshman3k
ID: 7068639
Hello!

Just put the following code in onShow event of your form:

{Set form size to full screen}
Form1.Left:=0;
Form1.Top:=0;
Form1.Height:= Screen.Height;
Form1.Width:= Screen.Width;

{make your window top-most,so it would be ontop of the taskbar and all other windows}
SetWindowPos(Form1.Handle, HWND_TOPMOST, 0,0,0,0,SWP_NOACTIVATE+SWP_NOMOVE+SWP_NOSIZE);

Hope this helps! ;-)

0
 
LVL 9

Expert Comment

by:ginsonic
ID: 7068834
Go to: http://www.delphi3000.com/article.asp?ID=1266 for
'Make your app to fill entire screen excluding taskbar' article .

To show over taskbar just change the SetBounds values with:

SetBounds(0,0, Screen.Width, Screen.Height);

0
 

Author Comment

by:aztec
ID: 7068865
Freshman3k - your suggestion does indeed make my form cover the whole screen, but the rightmost and bottommost part of my form is now blank and it looks crappy.

I guess what I mean to say is how to make my form - AND all its components - cover the full screen. I developed my app in a 800 X 600 resolution environment and my form covers the whole screen there (excluding taskbar) and it looks good; but when you run it on a 1024 X 768 environment, the right and bottom parts of my form are empty... all the components are still bunched over to the top and left. Do you see what I mean?
0
Independent Software Vendors: 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!

 
LVL 2

Expert Comment

by:freshman3k
ID: 7068877
hello!

oh ,I see what you mean
0
 

Author Comment

by:aztec
ID: 7068900
ok, so any idea how I can do it?
0
 
LVL 2

Accepted Solution

by:
freshman3k earned 50 total points
ID: 7068916
>ok, so any idea how I can do it?
yes,Try any of these components:

http://www.torry.net/vcl/sizers/sizers/easysize.zip
http://www.torry.net/vcl/sizers/sizers/eresizer.zip
http://www.torry.net/vcl/sizers/sizers/dcwinsizer.zip

they resize all the components on the form ,so the components resize with the form together

0
 
LVL 9

Expert Comment

by:ginsonic
ID: 7069011
Have you try my way ?
0
 

Author Comment

by:aztec
ID: 7069046
Hi Freshman3k, your form resizing suggestion, together with the 'easysize' resizing component works well, but my form now covers the taskbar. How do I get it to not do this? Does it have something to do with this statement:

SetWindowPos(Form1.Handle, HWND_TOPMOST, 0,0,0,0,SWP_NOACTIVATE+SWP_NOMOVE+SWP_NOSIZE);

Thanks
   Shawn
0
 
LVL 3

Expert Comment

by:raidos
ID: 7069321
Just a side note, the SWP_NOACTIVATE, SWP_NOMOVE, SWP_NOSIZE are intended to be used with an OR inbetween not a plus sign..

Like so...
SetWindowPos(Form1.Handle, HWND_TOPMOST, 0,0,0,0,SWP_NOACTIVATE OR SWP_NOMOVE OR SWP_NOSIZE);

And you should not use the entire screen if you do not want to obscure the taskbar.

Procedure SetSize;
Var
 R : TRect;
 I : LongBool;
begin
  I := SystemParametersInfo(SPI_GETWORKAREA, 0, @R, 0);
  If I Then Begin
    Top := R.Top;
    Height := R.Bottom - R.Top;
    Left := R.Left;
    Width := R.Right - R.Left;
  End;
End;

Regards
//raidos
0
 
LVL 3

Expert Comment

by:raidos
ID: 7069324
Ohh...i may have misunderstood your objective...

if you want your form to be below the taskbar change

HWND_TOPMOST to HWND_NOTOPMOST

Regards
//raidos
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 7070345
aztec ,

I think that you ignore me so I will leave this topic .

If you give couple minutes to my comments you can see that is the answer for your problem.

Read the title : 'Make your app to fill entire screen excluding taskbar'

This function calculate the all work area ( for any resolution ). The result is a FULL SCREEN FORM THAT DON'T COVER THE TASKBAR FOR ANY SCREEN RESOLUTION.

Wish you luck,
Nick

P.S. Tested already on my system .
0
 

Author Comment

by:aztec
ID: 7070385
ginsonic - I am not a 'member' of that group you mention. I cannot see your suggested answer! Can you list it for me?

Shawn
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 7070597
Whay don't register? Is a very good site and you can register for free and can read 50 articles from database and the all articles posted in that day . So if you visit daily the site can read all articles posted after your registration.
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 7070607
This is the code used by me :

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    procedure WMSettingChange( var Msg: TMessage); message WM_SETTINGCHANGE;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

function Area: TRect;
begin
 SystemParametersInfo(SPI_GETWORKAREA, 0, @Result, 0);
end;

procedure TForm1.WMSettingChange( var Msg: TMessage);
var R: TRect;
begin
 if (Msg.WParam=SPI_SETWORKAREA) then begin
   R:=Area;
   SetBounds(R.Left, R.Top, R.Right-R.Left, R.Bottom-R.Top);
   end;
 Msg.Result:=0;
end;

procedure TForm1.FormCreate(Sender: TObject);
var R: TRect;
begin
 R:=Area;
 SetBounds(R.Left, R.Top, R.Right-R.Left, R.Bottom-R.Top);
end;

end.
 
0
 

Author Comment

by:aztec
ID: 7070914
ginsonic - I get a compile error "File not found: "Variants.dcu". I'm using D3 Professional.

Shawn
0
 

Author Comment

by:aztec
ID: 7070994
Raidos - I don't understand your answer. What do I do with this procedure SetSize? Can you give me more details?
0
 

Author Comment

by:aztec
ID: 7071000
freshman3k are you there? Your suggestion covers my whole screen including the taskbar. i do not want to cover the taskbar.
0
 

Author Comment

by:aztec
ID: 7071003
So far I have received several suggestions, but no one has offered a complete solution that fully works.

Shawn
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 7071964
Remove Variants. I use D6 .
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 7071967
You don't need to add any unit , just the procedures .
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help on project with Soap 10 61
Breakpoint doesn't stop in my variable 3 36
can i put an image from resource into image tag ? 6 30
Delphi, TImage, Png 2 17
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…

680 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