Why is a maximized Delphi form 8 pixels wider and higher than the GetSystemMetrics values?

前端 未结 2 1654
萌比男神i
萌比男神i 2020-12-11 16:16

If I maximize a Delphi form the width and height values are 8 pixles greater that the corresponding GetSystemMetrics SM_CXSCREEN and SM_CYSCREEN?

For Example

2条回答
  •  孤街浪徒
    2020-12-11 17:04

    When maximized windows were originally implemented, the designers wanted to remove the resizing borders. Rather than removing them, they instead decided to draw those borders beyond the edges of the screen, where they would not be seen. Hence the rather surprising window rectangle of a maximized window.

    This implementation decision became a problem with the advent of multi-monitor systems. By that time there were applications that relied on this behaviour and so the Windows team decided to retain the behaviour for the sake of compatibility. This meant that maximized windows leaked onto neighbouring screens. In time the window manager acquired capabilities that meant it could suppress that leakage.

    Raymond Chen, as usual, has an article that covers the details: Why does a maximized window have the wrong window rectangle?

提交回复
热议问题