如何将窗口最小化到准确的先前状态(恢复或最大化)? [英] How to un-minimise a window to the exact previous state (restored or maximised)?

查看:64
本文介绍了如何将窗口最小化到准确的先前状态(恢复或最大化)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Windows 中,我有一个最小化的窗口,即前景窗口 (GetForegroundWindow).我现在想取消最小化窗口,使其再次可见.如何将窗口恢复到以前的状态?即,如果窗口在最小化之前被恢复"了,它应该被恢复,如果它在被最小化之前被最大化,它应该再次最大化,特别是没有恢复什么的.

看来我只能从{minimised,restored,maximised}中判断窗口的当前状态,但是理论上最小化和最大化应该是可以设置在一起的标志.

资源管理器任务栏如何知道在用户单击时显示窗口的状态?

解决方案

如果你使用类似 C 的东西,你可以看看 ShowWindow 函数:

ShowWindow(hWnd, SW_RESTORE)

<块引用>

SW_RESTORE
激活并显示窗户.如果窗口最小化或最大化,系统将其恢复为它的原始大小和位置.一个应用程序应指定此标志恢复最小化窗口时.

In Windows, I have a minimised window that is the foreground window (GetForegroundWindow). I now want to un-minimise the window so that it becomes visible again. How can I bring the window back to its previous state? I.e., if the window was "restored" before minimised, it should be restored, if it was maximised before being minimised, it should be maximised again and especially not restored or something.

It seems I can only determine the window's current state out of {minimised, restored, maximised}, but theoretically, minimised and maximised should be flags that can be set together.

How does the Explorer taskbar know in what state to show a window if the user clicks on it?

解决方案

If you use something like C, you can look on to ShowWindow function:

ShowWindow(hWnd, SW_RESTORE)

SW_RESTORE
Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized window.

这篇关于如何将窗口最小化到准确的先前状态(恢复或最大化)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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