Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delphi Apps Refuse To Start Up Maximised

Status
Not open for further replies.

TBaz

Technical User
Jun 6, 2000
65
ES
OK, a week or two ago, my Delphi 5 app started to initialise with a small gap running across the top of the screen and with the same portion of the main form appearing *under* the task bar. It's set to be maximised and I'm using XP Pro.

The same problem isn't present running the same app on other machines with XP Pro on, so I decided it was a faulty Windows - I had been experiencing other anomalies.

So, I reformatted and re-installed everything... and it still does it!

If I set the form to Normal instead of Maximised and set the Top and Left properties to 0 and the Width and Height to the desktop's Width and Height, I get the same result. It's as if Delphi thinks that 0,0 on the desktop is actually at 0,20.

To add to the mystery, tonight I discovered that if I set the task bar to Auto-hide, the problem disappears. Bring the Task bar back and so does the problem.

Anyone had this problem or more importantly, anyone know how to fix it please?

BC
 
Hi TenerifeBarrie,

I'm not really sure if this is just running your program or a programming thing. I went through allot to find the best way to make a program full screen when using Delphi, and here's what I did:

Put this in the FormCreate procedure, you'll need two variables:

var
sc_x : Integer;
sc_y : Integer;

.. then put this stuff.. between begin and end;

//Resize the window to full screen.
sc_x := GetSystemMetrics(SM_CXSCREEN);
sc_y := GetSystemMetrics(SM_CYSCREEN);
Tform1(self).Left :=0;
Tform1(self).Top :=0;
Tform1(self).Height := sc_y;
Tform1(self).Width := sc_x;

Your form will fill the screen when run.

Hope this helps,
Kevin
 
Quote:
"If I set the form to Normal instead of Maximised and set the Top and Left properties to 0 and the Width and Height to the desktop's Width and Height, I get the same result. It's as if Delphi thinks that 0,0 on the desktop is actually at 0,20."

I believe that's what you are suggesting I try, but as I said that doesn't work - the problem is that Delphi thinks that the top left corner of the desktop is lower down than it actually is. As such, my form always appears at X=0 but at the vertical position as though you had set the form's 'Top' property to 20.

It also works fine on other people's machines - it just seems to be mine causing the problem! :(

BC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top