0

On one XP machine my form is larger than the desktop when it is maximized. Does this have something to do Delphi or there are some settings that need adjustment in XP?

EDIT ; As you can see about 15% of the form is cut off while border icons are in place and are exactly where they should be when the form is maximized.No second monitor.enter image description here

user763539
  • 3,509
  • 6
  • 44
  • 103
  • Please provide some details. See [this question](http://stackoverflow.com/questions/14667558/why-is-a-maximized-delphi-form-8-pixels-wider-and-higher-than-the-getsystemmetri) for an example of how can a question can provide information so that it is evident what it asks. You can decide if this is a duplicate of that one while visiting. – Sertac Akyuz May 25 '14 at 12:50
  • I have seen that question but it does not help me. Usually, windows automatically adjusts maximized window to screen which means ClientWidth and ClientHeight are automatic.Window's client area is determined by resolution. So why is the form jumping out of the window's client area ? – user763539 May 25 '14 at 13:12
  • I don't know. I'd be surprised if someone knew with the available information. But it's your take... – Sertac Akyuz May 25 '14 at 13:17
  • @SertacAkyuz I would like to know WHY is this happening and is there a way to correct it. But, what other information do you need ? – user763539 May 25 '14 at 13:22
  • I don't even know if you observe this behavior with only a specific form. Or what it is exactly that you're observing. Does the system have multiple monitors and you see client area on other monitors? Or there is one monitor but content is missing? What's the size of the window? What should it be? In summary, we're not you and can't make the same observation with you. We only know what you've told. – Sertac Akyuz May 25 '14 at 13:29
  • You ask why. We ask what. Make it completely clear to us what the behaviour is. Show us how to reproduce the behaviour. – David Heffernan May 25 '14 at 14:46
  • This question encapsulates an issue that for me that had me fiddling with form sizes for ages back along. David M's answer is concise and so useful that I've up voted both. Don't be so hard on this questioner. – Brian Frost May 26 '14 at 06:40
  • @Brian - The issue here is claimed to be different since the questioner has dismissed usefulness of David M's answer even before it was provided. AAMOF the answer here is a duplicate of the accepted answer linked in the first comment, which didn't help the questioner according to his comment. – Sertac Akyuz May 26 '14 at 07:58
  • @Brian The question is unclear. We cannot tell what the issue is. You think it might be one thing. I guess we all thought that. But unless the asker provides details we are all guessing. – David Heffernan May 26 '14 at 08:23
  • @user thanks for the update. Can we have an SSCCE to reproduce the behaviour. – David Heffernan May 27 '14 at 06:43
  • I would wonder if there's any kind of custom frame on this form, considering the picture, like styles or the like. And the things I had wondered before, like if this is the only form that behaves like this, and what does it report its size to be And if there's any code attached to system events. But I'm not very much interested any more, tired of trying to pick out information... – Sertac Akyuz May 27 '14 at 09:11
  • Or MDI - is it a MDI child that's missing content while the parent is maximised? @user763539, please provide information! A screenshot is a good beginning, but we need context and data about your form, anything unusual it is doing (themes, MDI, frames, docking, libraries...) etc. – David May 27 '14 at 10:57

3 Answers3

7

This is because in old versions of Windows - that includes XP - a maximised window was made large enough that the window border is not visible. The window border isn't removed, it's just that the window is made ever-so-slightly larger than the screen and then centered over the screen, so the borders are not visible.

You can see this if you have multiple monitors: depending on your version of Windows, if you maximise a window on one screen you may see the window's edge appear on the side of the other monitor.

This is not a bug, and not something to solve either via Windows settings or in Delphi.

This was visually solved in Vista: the borders are still there (and the window size may report a different size to the screen size) but the overhanging border is not drawn.

You can read more on Raymond Chen's blog post about the topic.

David
  • 13,360
  • 7
  • 66
  • 130
  • @DavidHeffernan I wish he/she had posted all that info yesterday. I wrote a beautifully correct answer for the wrong question ;) – David May 27 '14 at 10:58
  • @DavidM - *"all that info"* ? I guess you're kidding.. Anyway, if you per chance happened to read the first two comments to the question, you'd then know the asker didn't consider this to be the solution. – Sertac Akyuz May 27 '14 at 16:59
  • @SertacAkyuz Well, there isn't much extra info ;) But enough to make it more clear what the problem is not, even if there's not enough info to know what the problem is. I don't think I had read those comments when I posted this - they might not even have existed yet. – David May 28 '14 at 08:48
  • @DavidM - They did, but it doesn't matter, you don't have to read comments. Many people don't read them I figure. – Sertac Akyuz May 28 '14 at 08:51
3

It is quite posible that your end user is using one of those software used for extending the desktop space. What such programs does is that they extend the work area size if certain monitor and any application window always resize to workarea boundaries.

I recomend you try running this code on your end users computer to get more information about its screen size, workarea size, how many screens does he use etc.

procedure CheckScreenInfo;
var I: Integer;
begin
  Memo1.Lines.Clear;
  Memo1.Lines.Add('Monitor count:'+IntToStr(Screen.MonitorCount));
  Memo1.Lines.Add('Form is on monitor:'+IntToStr(Form4.Monitor.MonitorNum));
  Memo1.Lines.Add('Desktop left:'+IntToStr(Screen.DesktopLeft));
  Memo1.Lines.Add('Desktop top:'+IntToStr(Screen.DesktopTop));
  Memo1.Lines.Add('Desktop width:'+IntToStr(Screen.DesktopWidth));
  Memo1.Lines.Add('Desktop height:'+IntToStr(Screen.DesktopHeight));
  Memo1.Lines.Add('Screen width:'+IntToStr(Screen.Width));
  Memo1.Lines.Add('Screen height:'+IntToStr(Screen.Height));
  Memo1.Lines.Add('Work area left:'+IntToStr(Screen.WorkAreaLeft));
  Memo1.Lines.Add('Work area top:'+IntToStr(Screen.WorkAreaTop));
  Memo1.Lines.Add('Work area width:'+IntToStr(Screen.WorkAreaWidth));
  Memo1.Lines.Add('Work area height:'+IntToStr(Screen.WorkAreaHeight));
  for I := 0 to Screen.MonitorCount -1 do
  begin
    Memo1.Lines.Add('#####-Monitor '+IntToStr(Screen.Monitors[I].MonitorNum)+'-#####');
    Memo1.Lines.Add('Monitor left:'+IntToStr(Screen.Monitors[I].Left));
    Memo1.Lines.Add('Monitor top:'+IntToStr(Screen.Monitors[I].Top));
    Memo1.Lines.Add('Monitor width:'+IntToStr(Screen.Monitors[I].Width));
    Memo1.Lines.Add('Monitor height:'+IntToStr(Screen.Monitors[I].Height));
    Memo1.Lines.Add('Monitor workarea top:'+IntToStr(Screen.Monitors[I].WorkareaRect.Top));
    Memo1.Lines.Add('Monitor workarea left:'+IntToStr(Screen.Monitors[I].WorkareaRect.Left));
    Memo1.Lines.Add('Monitor workarea width:'+IntToStr(Screen.Monitors[I].WorkareaRect.Width));
    Memo1.Lines.Add('Monitor workarea height:'+IntToStr(Screen.Monitors[I].WorkareaRect.Height));
    Memo1.Lines.Add('Monitor bounds top:'+IntToStr(Screen.Monitors[I].BoundsRect.Top));
    Memo1.Lines.Add('Monitor bounds left:'+IntToStr(Screen.Monitors[I].BoundsRect.Left));
    Memo1.Lines.Add('Monitor bounds width:'+IntToStr(Screen.Monitors[I].BoundsRect.Width));
    Memo1.Lines.Add('Monitor bounds height:'+IntToStr(Screen.Monitors[I].BoundsRect.Height));
  end;
end;
SilverWarior
  • 7,372
  • 2
  • 16
  • 22
0

Are you sure the screen offsets/sizes are correct? The edges may be outside the desktop area without it being noticeable. Try going to the monitors calibration menu and verify the top left/bottom right offsets.

It's also possible to set the screen size larger than screen can handle.

Does the screen scroll when you move around the desktop?

If so, I'm think that's the issue, in which case you'll need to play around with the screen resolution or desktop settings.

My bet is on the first solution, though.

Galdur
  • 131
  • 4