Solved

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

Posted on 2002-06-10
20
185 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 2

Expert Comment

by:freshman3k
Comment Utility
hello!

oh ,I see what you mean
0
 

Author Comment

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

Accepted Solution

by:
freshman3k earned 50 total points
Comment Utility
>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
Comment Utility
Have you try my way ?
0
 

Author Comment

by:aztec
Comment Utility
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
Comment Utility
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
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 9

Expert Comment

by:ginsonic
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
ginsonic - I get a compile error "File not found: "Variants.dcu". I'm using D3 Professional.

Shawn
0
 

Author Comment

by:aztec
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Remove Variants. I use D6 .
0
 
LVL 9

Expert Comment

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

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now