Windows 中的單一視窗模式

Windows 中的單一視窗模式

我希望一次只最大化一個視窗。當我切換到不同的視窗時,前一個(或任何其他)視窗應該最小化。 Mac 有它,它被稱為單一應用程式模式。

使用⊞ Win+ Home,我可以最小化其他窗口,但每次都需要按下它。如何在 Windows 中自動執行此操作?

答案1

在 Autohotkey 中您可以使用設定定時器最大化實際活動窗口,同時最小化任何其他窗口:

#NoEnv
#SingleInstance Force

; Press F1 to enable/disable single window mode:

F1::   ; toggles the variable "enabled" between true and false
enabled := !enabled
If (enabled)
     SetTimer, single_window_mode, 10
else
     SetTimer, single_window_mode, off   ; disable single window mode
return

     single_window_mode:
If IsWindow(WinExist("A"))
{   
    WinGet, WinState_A, MinMax, A
    If (WinState_A != 1) ; the active window isn't maximized 
    {
        WinMaximize, A
        WinGet, id, list
        Loop, %id%
        {
            this_ID := id%A_Index%
            If NOT IsWindow(WinExist("ahk_id" . this_ID))
                continue
            IfWinActive, ahk_id %this_ID%
                continue
            WinGet, WinState, MinMax, ahk_id %this_ID%
            If (WinState != -1) ; the window isn't minimized
            {
                WinRestore, ahk_id %this_ID%
                Sleep 300
                WinMinimize, ahk_id %this_ID%               
            }
        }
    }
}
return

; This checks if a window is, in fact a window.
; As opposed to the desktop or a menu, etc.
IsWindow(hwnd){
   WinGet, s, Style, ahk_id %hwnd%
   return s & 0xC00000 ? (s & 0x100 ? 0 : 1) : 0
}

答案2

有幾種方法。

需要軟體或腳本來執行此操作。

我有經驗實際工具視窗最小化器它具有在停用時自動最小化任何視窗的功能,並具有添加例外和其他功能。

如果您使用具有顯示器的 Windows 10,則可以使用平板電腦模式,該模式會自動將任何程式設定為全螢幕。它不會最小化其他程序,但感覺仍然是一樣的。不過,您需要周年紀念更新。點擊時鐘右側的通知圖標,然後按平板電腦模式。如果它呈灰色,請確保已停用多個顯示器。將其設定到其中一台顯示器,或複製。不適用於擴充。

答案3

原始版本可作為腳本(AHK - AutoHotKey)或執行檔:

http://www.donationcoder.com/Software/Skrommel/index.html#MinimOther

最小其他 v1.1 透過斯克羅梅爾

Size: 205KB

Endlessly minimizes all windows except the active one.

Features:

    ► Won't minimize dialog boxes.

Changes:

    ► 2005.12.02 - v1.1: Restores next window when current window closes.

感謝 DonationCoder 論壇的 knyghte 提出這個想法!

相關內容