TONT 36483 为什么最小化的窗口具有形式上的160×31的尺寸?

原文链接:https://devblogs.microsoft.com/oldnewthing/20050210-00/?p=36483

We discussed a few months ago the issue of where windows minimized to before the taskbar was invented. In the modern taskbar world, why do minimized windows have an apparent size of 160×31?

几个月前,我们讨论过在任务栏发明之前的最小化窗口的问题。那么在如今任务栏一统天下的时代,为什么最小化的窗口会有一个形式上的160×31的尺寸呢?

The size isn’t just apparent. That’s really their size. You can see them, for example, if you fire up a program that uses the Multiple Document Interface.

这个尺寸不光是形式上的,实际上也是如此。你可以通过一些方式观察到这一点,例如启动一个食用了多文档界面(MDI)的程序。

(译注:原本这里有一张图片,但已经失效,请运用你的想象力)

Observe the appearance of the window “Book1”. This is a minimized window (though minimized to its MDI host rather than to the desktop). With the introduction of Windows Explorer, which put files on the desktop in the form of icons, it became necessary to change the appearance of minimized windows in order to avoid confusing a minimized program icon from a desktop icon. A minimized program, therefore, took the form of a miniature title bar.

观察这个叫『Book1』的窗口的外观。这是一个最小化的窗口(尽管是最小化到其MDI顶层窗口而不是桌面)。在引入了Windows资源管理器之后,桌面上允许以图标的形式放置文件了,修改最小化窗口的形式便变得有必要起来,以防人们将最小化的程序图标与文件图标相混淆(译注:Windows 95之前版本的Windows没有任务栏,最小化的程序会缩小为『桌面』上的一个图标,这里的桌面指的是『程序管理器』背后的整个屏幕空间,与Windows 95之后的『桌面』并不是同一个概念)。由此,最小化的程序使用了缩小的标题栏的形式。

The programming interface to minimized windows remained the same, for compatibility reasons. (And please let’s just agree to disagree on whether backwards compatibility is a good thing or not.) That’s why the function to tell whether a window is minimized continues to be called IsIconic, the message you receive when someone tries to restore a minimized program is still called WM_QUERYOPEN, and the OpenIcon function can still be used to “open” a minimized “icon”. All even though minimized windows haven’t looked like icons for nearly ten years.

面向最小化窗口的编程接口(与旧版Windows)保持了一致,这是出于兼容性的考虑。(至于向下兼容是一件好事还是坏事,请保持见仁见智的态度。)这就是为什么用来判断一个窗口是否最小化的方法名延续了 IsIconic 的称呼:当用户尝试复原最小化的程序时,程序获得信息仍然叫 WM_QUERYOPEN,而 OpenIcon 方法仍然可以用来『打开』一个最小化的『图标』,尽管保留了上述这些特性的同时,最小化的窗口已经跟图标的长相大相径庭将近十年了。

The OpenIcon function is just an old-fashioned way of saying ShowWindow(hwnd, SW_NORMAL), in the same way that the CloseWindow function (dating back to Windows 1.0) is an extremely old-fashioned way of saying ShowWindow(hwnd, SW_MINIMIZE).

OpenIcon 方法不过是 ShowWindow(hwnd, SW_NORMAL) 的一种旧式叫法,与此相同的还有 CloseWindow(可以追溯到 Windows 1.0)也只是 ShowWindow(hwnd, SW_MINIMIZE) 相对应的超级老的一种叫法而已。

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

 剩余字数 ( Characters available )

Your comment will be available after auditing.
您的评论将在通过审核后显示。

Please DO NOT add any links in your comment, otherwise it would be identified as SPAM automatically and never be audited.
请不要在评论中插入任何链接,否则将被自动归类为垃圾评论,且永远不会被提交给博主进行复审。

*