在 Windows 10 中同一应用程序的两个窗口之间切换的简单方法

JOK*_*OKe 45 alt-tab windows-10

我正在寻找一种使用快捷键在同一应用程序的两个打开窗口之间切换的方法,我发现了这个https://neosmart.net/EasySwitch/但它不是开源的,我什至不相信它能工作。有人有替代方案吗?这是 Unity 和 Mac OS 中的 OOTB,Windows 没有它是荒谬的。

前段时间,一位微软员工制作了这个工具:https://switcher.en.softonic.com/不知道官方网站是什么,它很棒,但只能在 Windows 7 上运行,不能在 10 上运行,也不是开源的。

我发现的最接近开源的东西是这个https://github.com/JochenBaier/fastwindowswitcher但不太理想。

有替代方案吗?

Saa*_*arg 42

有三种方法可以做到这一点:

  1. 您可以按住 Ctrl + 单击任务栏中应用程序的图标
  2. 使用Win+ 应用程序在任务栏上的位置。例如,如果 Google Chrome 位于第三位,请执行Win+3在 Chrome 窗口之间切换。请注意,这会循环显示不同的窗口,因此要打开第四个窗口,您必须按 3 四次。
  3. 其中最快的是,使用Win++完全ctrl可以满足n您的需求。(其中 n 是应用程序在任务栏上的位置)

请注意,在第二个和第三个选项中,如果指定了 n,使得该程序的任何窗口都没有打开,则 Windows 将打开一个新窗口。无论该应用程序的窗口是否已打开,也可以通过按Win+ shift+来实现此效果。n

  • 如果 n 大于 9 怎么办? (3认同)
  • 在我看来,这并不能很好地回答OP,因为您需要记住任务栏中窗口的顺序,而且我还假设这里不可以选择使用鼠标 (3认同)
  • 这是一个不错的选择,因为不需要安装并向操作系统添加某些内容。当然也有上面提到的限制。 (2认同)

har*_*ymc 42

您可以使用免费的AutoHotkey自行 实现Alt+快捷方式。`

以下脚本将循环浏览活动进程的所有窗口:

!`::
WinGetClass, OldClass, A
WinGet, ActiveProcessName, ProcessName, A
WinGet, WinClassCount, Count, ahk_exe %ActiveProcessName%
IF WinClassCount = 1
    Return
loop, 2 {
  WinSet, Bottom,, A
  WinActivate, ahk_exe %ActiveProcessName%
  WinGetClass, NewClass, A
  if (OldClass <> "CabinetWClass" or NewClass = "CabinetWClass")
    break
}
Run Code Online (Sandbox Code Playgroud)

安装完AutoHotKey后,将上述文本放入一个.ahk文件中,双击进行测试。您可以通过右键单击托盘栏中的绿色 H 图标并选择“退出”来停止脚本。要使其在登录时运行,请将其放置在位于 的启动组中
C:\Users\USER-NAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

有用的 AutoHotkey 文档:

  • 是否可以像 alt+tab 一样显示窗口预览? (2认同)

9cc*_*cco 13

我已经更新了 harrymc 的脚本,使其可以在 AutoHotkey v2 中执行:

#Requires AutoHotkey v2.0

!`::{
  OldClass := WinGetClass("A")
  ActiveProcessName := WinGetProcessName("A")
  WinClassCount := WinGetCount("ahk_exe" ActiveProcessName)
  IF WinClassCount = 1
      Return
  loop 2 {
    WinMoveBottom("A")
    WinActivate("ahk_exe" ActiveProcessName)
    NewClass := WinGetClass("A")
    if (OldClass != "CabinetWClass" or NewClass = "CabinetWClass")
      break
  }
}
Run Code Online (Sandbox Code Playgroud)

由此,转换 EugeneK 的脚本也应该很容易。

我也尝试在 v2 中实现 EugeneK 的脚本。我不确定它是否具有所有预期的功能,但它工作正常并且将是我将要使用的

#Requires AutoHotkey v2.0

!`::
{
    win_id := WinActive("A")
    win_class := WinGetClass("A")
    active_process_name := WinGetProcessName("A")
    ; We have to be extra careful about explorer.exe since that process is responsible for more than file explorer
    if (active_process_name = "explorer.exe")
        win_list := WinGetList("ahk_exe" active_process_name " ahk_class" win_class)
    else
        win_list := WinGetList("ahk_exe" active_process_name)
    
    ; Calculate index of next window. Since activating a window puts it at the top of the list, we have to take from the bottom.
    next_window_i := win_list.Length
    next_window_id := win_list[next_window_i]
    
    ; Activate the next window and send it to the top.
    WinMoveTop("ahk_id" next_window_id)
    WinActivate("ahk_id" next_window_id)
}
Run Code Online (Sandbox Code Playgroud)

另外:我喜欢将此功能与Alt + |键绑定在一起。。因此,如果您也更喜欢这个,请更改!'::!|::.


小智 5

我修改了 ahk 脚本以便进行 Ubuntu 风格切换。按住`某个键时按下alt将循环浏览所有应用程序窗口,将下一个窗口放在顶部,而不是将顶部窗口发送到底部。单个alt + `组合将在最后两个窗口之间循环。

!`::
WinGet, ActiveProcessName, ProcessName, A
WinGet, WinClassCount, List, ahk_exe %ActiveProcessName%

if (WinClassCount = 1)
    return

if (NextWindow = "")
    NextWindow := 2

element := % WinClassCount%NextWindow%

WinSet, Top,, ahk_id %element%
WinActivate, ahk_id %element%

NextWindow += 1

if (NextWindow > WinClassCount || !getKeyState("Alt"))
    NextWindow := 2

return
Run Code Online (Sandbox Code Playgroud)


归档时间:

查看次数:

26556 次

最近记录:

2 年 前