TONT 37453 在任务栏被发明出来之前,最小化的窗口都去了哪里?

请注意:本页内容发布于 1731 天前,内容可能已经过时,请注意甄别。

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

Before Explorer was introduced in Windows 95, the Windows desktop was a very different place.

在资源管理器被引入到 Windows 95 之前,桌面是完全大相径庭的另一个物种。

The icons on your desktop did not represent files; rather, when you minimized a program, it turned into an icon on the desktop. To open a minimized program, you had to hunt for its icon, possibly minimizing other programs to get them out of the way, and then double-click it. (You could also Alt+Tab to the program.)

桌面上的图标不是用来代表文件的,与这种印象不同,当你最小化一个程序时,程序就会变成桌面上的一个图标。要打开一个最小化的程序,你得先找到它的图标,或许还得先把其他挡住视线的程序最小化,然后再双击图标(来打开这个最小化的程序)。(你也可以用Alt+Tab切换过去。)

Explorer changed the desktop model so that icons on your desktop represent objects (files, folders) rather than programs. The job of managing programs fell to the new taskbar.

资源管理器改变了桌面的模型,此后桌面上的图标就变成了代表对象(文件、文件夹)而不是程序。管理程序的任务就落到了新生的任务栏上。

But where did the windows go when you minimized them?

不过当程序最小化的时候,它的窗口去哪了呢?

Under the old model, when a window was minimized, it displayed as an icon, the icon had a particular position on the screen, and the program drew the icon in response to paint messages. (Of course, most programs deferred to DefWindowProc which just drew the icon.) In other words, the window never went away; it just changed its appearance.

在旧的模型之下,当一个窗口最小化时,其表现为一个图标,这个图标在屏幕上有特定的位置,而程序在响应描画的窗体消息时,会对这个图标进行绘制。(当然,大多数程序推迟了绘制图标的 DefWindowProc 方法。)换句话说,程序的窗口从来都没有消失,只是换了个表现形式。

But with the taskbar, the window really does go away when you minimize it. Its only presence is in the taskbar. The subject of how to handle windows when they were minimized went through several iterations, because it seemed that no matter what we did, some program somewhere didn’t like it.

但自从有了任务栏以后,最小化的程序的窗口就真的消失了,其存在就仅仅表现在任务栏中而已。对于如何管控最小化的窗口的设计经历了几次迭代,原因是不管我们做什么,总有一些应用程序不喜欢。

The first try was very simple: When a window was minimized, the Windows 95 window manager set it to hidden. That didn’t play well with many applications, which cared about the distinction between minimized (and visible) and hidden (and not visible).

第一次的尝试很简单:当一个窗口最小化后,Windows 95 的窗口管理器就将其设置为隐藏。这样的设计与很多程序配合都不好,因为这些程序会严格区分最小化(同时可见)与隐藏(同时不可见)的区别。

Next, the Windows 95 window manager minimized the window just like the old days, but put the minimized window at coordinates (-32000, -32000), This didn’t work because some programs freaked out if they found their coordinates were negative.

后来,Windows 95 的窗口管理器用以往的方法将窗口最小化,但将最小化的窗口移动到坐标(-32000,-32000)。这样做的效果依然不彰,因为有些程序发现自己的坐标是负值时感觉非常不安。

So the Windows 95 window manager tried putting minimized windows at coordinates (32000, 32000), This still didn’t work because some programs freaked out if they found their coordinates were positive and too large!

所以Windows 95的窗口管理器又转而尝试将最小化的窗口放到坐标(32000,32000)上。这样做的效果仍旧不好,因为有些程序发现自己的坐标是很大的正值时吓坏了。

Finally the Windows 95 window manager tried coordinates (3000, 3000), This seemed to keep everybody happy. Not negative, not too large, but large enough that it wouldn’t show up on the screen (at least not at screen resolutions that were readily available in 1995).

最终,Windows 95 窗口管理器将移动的坐标换成了(3000,3000),这样大家似乎都很满意了。不是负值,不是很大的值,但又足够大使得不会显示在屏幕上(至少以1995年较常见的屏幕分辨率来说如此)。

If you have a triple-monitor Windows 98 machine lying around, you can try this: Set the resolution of each monitor to 1024×768 and place them corner-to-corner. At the bottom right corner of the third monitor, you will see all your minimized windows parked out in the boonies.

如果你有一台三显示器配置的 Windows 98 机器在手边,你可以尝试这样操作一下:将每台显示器的分辨率设置为1024×768,然后将三台显示器底角对顶角地排列起来。在右下角的第三台显示器上,你就能看到那些最小化的窗口们在屏幕的『郊区』安居乐业的样子了。

(Windows NT stuck with the -32000 coordinates and didn’t pick up the compatibility fixes for some reason. I guess they figured that by the time Windows NT became popular, all those broken programs would have been fixed. In other words: Let Windows 95 do your dirty work!)

(出于某些原因,Windows NT 则保留了移动到坐标-32000的做法,没有采用(移动到坐标3000的)那个兼容性补丁。我猜开发人员们大概在想等 Windows NT 普及了,那些不听话的应用程序大概都已经修复这个问题了。换句话说:让 Windows 95 去做那些苦活吧!)

Comments

  1. 最一开始大概是DOS的多任务,是靠热键唤出,超难用。
    Win3.x的多任务就很奇葩,还好只是昙花一现。
    结果后来Ubuntu的Unity就山寨了一个不伦不类的出来,桌面上和任务栏上是快捷方式,打开之后就变成了进程(?),搞得桌面系统像是 Win3.x+Android 。
    我记得后来Windows的最小化改成了窗口大小 0x0,可以用一定手段移动这个窗口,不知道是哪个版本改的。

  2. 通过修改窗口坐标来实现最小化“隐藏”窗口,可笑而无奈。
    真没想到他们居然会采用这种方式。

发表回复

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

 剩余字数 ( 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.
请不要在评论中插入任何链接,否则将被自动归类为垃圾评论,且永远不会被提交给博主进行复审。

*