Windows 7 中的键盘快捷键到中心窗口

Sar*_*els 24 windows windows-7 keyboard-shortcuts

我发现 Win-left 箭头和 Win-right 箭头在 Windows 7 中非常有用,可以使窗口分别占据屏幕左侧或右侧的 50%。但是,是否有任何命令可以使窗口占据屏幕的 50% 并居中?即使它不调整窗口的大小,是否有键盘快捷键可以使窗口垂直和水平居中?谢谢。

小智 18

这并不完全是为了居中,但可以让您轻松地左右(以及上下)移动窗口。

  1. 聚焦一个窗口。
  2. Alt+ Space
  3. M(用于“移动”)。
  4. 使用箭头键将窗口准确移动到您想要的位置。
  5. Enter完成后按下。


wbe*_*d52 14

Windows+箭头键在这里非常有用。

  • (Windows)+← (Left)+→ (Right) 循环向左或向右移动 50% 的屏幕,并将窗口恢复到其原始大小和位置。
  • +↑ (Up)最大化窗口。
  • +↓ (Down) 如果窗口最大化,则恢复窗口,否则将其最小化。

  • @wbeard52:我只是反复尝试 Win-Left,它在屏幕左侧循环 50%,在屏幕右侧循环 50%,以及我的窗口最初的样子(不居中,小)。 (3认同)
  • 这对我来说似乎不起作用。看起来它最小化了我的窗口,或者如果窗口最大化则恢复它。 (2认同)
  • 在我的机器上,双显示器,我可以单击 Win-Left,它会在该屏幕上向左移动 50%。如果我继续单击 Win-Left,它将在另一个屏幕上向右移动 50%,然后将居中,最后在另一个屏幕上左移。双赢正好相反 (2认同)
  • 反复按 Win-Left 或 Win-Right 只需循环将窗口放置在可用监视器的左/右 50% 上,然后将其放回原来的位置。它不会以任何方式使窗口居中。 (2认同)

vct*_*tls 5

我建议使用AutoHotkey
另一个问题的回答中已经提供了一个完全按照您的要求执行的示例脚本。
这是脚本的代码:

#!Up::CenterActiveWindow() ; if win+alt+? is pressed

CenterActiveWindow()
{
    ; Get the window handle from de active window.
    winHandle := WinExist("A")

    VarSetCapacity(monitorInfo, 40)
    NumPut(40, monitorInfo)

    ; Get the current monitor from the active window handle.
    monitorHandle := DllCall("MonitorFromWindow", "uint", winHandle, "uint", 0x2)
    DllCall("GetMonitorInfo", "uint", monitorHandle, "uint", &monitorInfo) 

    ; Get WorkArea bounding coordinates of the current monitor.
    A_Left   := NumGet(monitorInfo, 20, "Int")
    A_Top    := NumGet(monitorInfo, 24, "Int")
    A_Right  := NumGet(monitorInfo, 28, "Int")
    A_Bottom := NumGet(monitorInfo, 32, "Int")

    ; Calculate window coordinates.
    winW := (A_Right - A_Left) * 0.5 ; Change the factor here to your desired width.
    winH := A_Bottom
    winX := A_Left + (winW / 2)
    winY := A_Top

    WinMove, A,, winX, winY, winW, winH
}
Run Code Online (Sandbox Code Playgroud)

我做了一个轻微的调整,使窗口底部不会位于任务栏下方,并将其windowWidth从 0.7更改为 0.5。

编辑:现在使用多个监视器,并使用工作区作为顶部和底部值。

附带说明一下,WinSplit Revolution 已停产,取而代之的是一款名为 MaxTo 的付费应用程序。
除了非常强大并涵盖更多用例之外,AutoHotkey 还是免费和开源的。


Tam*_*man 3

你应该看看WinSplit Revolution;它有您需要的东西并且可以定制。

替代文本