为什么最大化的Delphi比GetSystemMetrics值更宽和更高的8像素? [英] Why is a maximized Delphi form 8 pixels wider and higher than the GetSystemMetrics values?

查看:126
本文介绍了为什么最大化的Delphi比GetSystemMetrics值更宽和更高的8像素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我最大化一个Delphi格式,宽度和高度值是相应的GetSystemMetrics SM_CXSCREEN和SM_CYSCREEN的8像素?

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

例如:

当我右键单击我的屏幕并获取属性时,我有一个1680 X 1050屏幕分辨率。这些是从GetSystemMetrics(SM_CXSCREEN)和GetSystemMetrics(SM_CYSCREEN)返回的相同的值。

When I right click on my screen and get properties I have a 1680 X 1050 screen resolution. Those are the same values returned from GetSystemMetrics(SM_CXSCREEN) and GetSystemMetrics(SM_CYSCREEN).

当我在Delphi应用程序中最大化表单时,我获得宽度为1688和高度为1058。有8个像素差异。什么原因导致这种差异?

When I maximize the form in my Delphi application I get a width of 1688 and a height of 1058. There is an 8 pixel difference. What causes this difference?

推荐答案

当最初实现最大化的窗口时,设计者想要删除调整大小的边框。而不是删除它们,而是决定绘制边界超出屏幕的边缘,在那里他们不会被看到。因此,最大化窗口的令人惊讶的窗口矩形。

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.

这种实现决定成为多监视器系统出现的问题。那时候有一些依赖这个行为的应用程序,所以Windows团队决定为了兼容而保留这个行为。这意味着最大化的窗口泄漏到相邻的屏幕上。在窗口管理器获得能力的时候,这意味着它可以抑制泄漏。

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 ,像往常一样,有一篇文章涵盖了细节:为什么最大化的窗口有错误的窗口矩形?

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

这篇关于为什么最大化的Delphi比GetSystemMetrics值更宽和更高的8像素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆