我喜欢在全屏模式下以窗口模式玩电脑游戏。我不喜欢盯着标题栏,框架和其他UI垃圾。我也不喜欢在窗口周围的桌面上看到其他内容。是否有一个简单的Windows程序将从其他应用程序的任意窗口中剥离UI镶边?加分点是一种在窗口下方放置黑屏,隐藏桌面的简便方法。
注意:我正在专门处理小于桌面尺寸的窗口。有多种“窗口最大化”选项,这些选项可使窗口恰好与桌面大小相同,并且位置也是如此,因此所有UI装饰均不在屏幕上。(例如:ShiftWindow)。我正在尝试从小于桌面大小的窗口中剥离所有装饰。
我喜欢在全屏模式下以窗口模式玩电脑游戏。我不喜欢盯着标题栏,框架和其他UI垃圾。我也不喜欢在窗口周围的桌面上看到其他内容。是否有一个简单的Windows程序将从其他应用程序的任意窗口中剥离UI镶边?加分点是一种在窗口下方放置黑屏,隐藏桌面的简便方法。
注意:我正在专门处理小于桌面尺寸的窗口。有多种“窗口最大化”选项,这些选项可使窗口恰好与桌面大小相同,并且位置也是如此,因此所有UI装饰均不在屏幕上。(例如:ShiftWindow)。我正在尝试从小于桌面大小的窗口中剥离所有装饰。
Answers:
阅读voodoomsr的评论后,我为自己的目的做了一些小准备。使它左上角并调整为我的全分辨率。恢复之前的状态。不能同时与多个应用程序一起使用。
谢谢voodoomsr
;-Caption
LWIN & LButton::
SetTitleMatchMode, 2
WinGetPos, X, Y, Width, Height, A
WinSet, Style, -0xC00000, A
WinMove,A,,0,0,1920,1080
return
;
;+Caption
LWIN & RButton::
WinSet, Style, +0xC00000, A
WinMove,A,,%X%,%Y%,%Width%,%Height%
Sleep, 1000
Sleep, 1000
return
;
编辑:
TBH我试图找到一些对Windows有用的东西,这些东西不能调整大小但找不到任何东西(不是说不可能,这实际上是我的第一个Autohotkey脚本)。
好吧,无论如何,我做了一些调整,例如消除不必要的睡眠,使用Nelson建议的样式,并使其仅用一个按钮即可使用,因此双击不会覆盖已保存的变量。
#SingleInstance force
; Exclude the desktop
; Note: Also excludes "My Computer" browsing windows.
; Better detection might be needed to differentiate the parent explorer "ahk_id" from child windows.
; Also seems to disregard accidental Metro interface clicks (Win 8+)
#IfWinNotActive ahk_exe explorer.exe
; Set your resolution (minus decorations like start bars if you wish to leave those on-screen.
w = 1920
h = 1080
w_wasted = 6 ; width used by resize bars
h_wasted = 29 ; width used by caption frame and resize bars
; Window to fullscreen
LWIN & LButton::
SetTitleMatchMode, 2
WinGet Style, Style, A
; 0xC40000 = WS_BORDER (0x800000) + WS_DLGFRAME (0x400000) + WS_SIZEBOX aka WS_THICKFRAME (0x040000)
if(Style & 0xC00000) { ; if has WS_CAPTION. Ignore sizebox value.
WinGetPos, X, Y, Width, Height, A
WinSet, Style, -0xC40000, A ; removes attributes, including sizebox...doesn't do a strict subtraction
WinMove,A,,0,0,w,h
} else {
WinSet, Style, +0xC40000, A
; Note: will set WS_SIZEBOX even if not previously present
if(Width > w - w_wasted) {
Width := %w%-%w_wasted%
}
if(Height > h - h_wasted) {
Height := %h%-%h_wasted%
}
WinMove,A,,%X%,%Y%,%Width%,%Height%
}
WinSet Redraw
Return
只需使用以下自动热键脚本:
;-Caption
LWIN & LButton::
WinSet, Style, -0xC00000, A
return
;
;+Caption
LWIN & RButton::
WinSet, Style, +0xC00000, A
return
;
您可以从此处http://www.autohotkey.com/download/下载autohotkey 。保存扩展名为.ahk的文件,然后像运行任何应用程序一样运行它。
用法:
删除标题栏LWindowButton +左键单击
恢复标题栏LWindowButton +右键单击
这是一个可以删除任何窗口标题栏的程序。为此,您必须在WinExplorer树形视图中选择“游戏”窗口,然后切换到“样式”选项卡并关闭WS_DLGFRAME。
使用AutoHotKey和自动隐藏任务栏。
LWin & f::
WinGet Style, Style, A
if(Style & 0xC40000) {
WinSet, Style, -0xC40000, A
WinMaximize, A
} else {
WinSet, Style, +0xC40000, A
WinRestore, A
}
return
为什么要使用WinMaxmize
?请参阅Asd答案的评论。
Skrommel制作的CutAway可能会做您想要的。
如果可以编写代码,并且正在运行Vista或更高版本,则可以很容易地创建一个将DWM缩略图注册到应用程序的程序,然后可以选择仅在该缩略图中显示无边框的窗口内容。您还必须以某种方式将来自此叠加程序的所有输入转发给游戏,但这也不是那么复杂。
我不再运行Windows,因此无法进行测试,但是无边界游戏是一个有前途的开源应用程序,可以解决此问题。它显示了正在运行的应用程序列表,并允许您选择其中一个来操作窗口。
我在使用特定窗口时遇到问题,使用@weakish的方法和Mikuz的框架会为最大化的窗口获取正确的窗口大小,但无法定位到正确的位置。
这是我的ahk解决方案
;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win2000+
; Author: mpag derived from Mikuz
;
; Script Function:
; Window to "supermaximized". mpag solution from http://superuser.com/q/38687/319748
; If you want fullscreen (no toolbars) try replacing calls to function WinSuperMax with WinFullscreen
; This script may still be in development
; Bugs:
; 1) Doesn't display scrollbars in standard maximized screen if it lost them upon supermax (unless you restore and re-maximize)
; 2) If supermaxing a background window that has menus within the Caption bar (e.g. firefox), you functionally just maximize but lose the min/restore/close buttons. Probably has something to do with the Style value.
; Memory Management/Clarity:
; 3) Doesn't clear G_ variable values before each run. if the number of monitors (virtual or otherwise) reduces, values for higher monitor numbers will still be set, but MonCount should still be valid and restrict use. also picks first match.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance force
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
MonGetCoords() {
global ; for setting
SysGet G_MonCount, MonitorCount
loop %G_MonCount% {
SysGet G_MonWA%A_Index%, MonitorWorkArea, %A_Index%
SysGet G_MonFS%A_Index%, Monitor, %A_Index%
}
}
GetMon4xy(ByRef x="", ByRef y="", ByRef m="") {
global ; getting
local l:=0, u:=0
m := 0 ; even if sent, we want to clear it
loop %G_MonCount% {
l := G_MonFS%A_Index%Left
u := G_MonFS%A_Index%Right
if x not between %l% and %u%
continue
l := G_MonFS%A_Index%Top
u := G_MonFS%A_Index%Bottom
if y not between %l% and %u%
continue
m := A_Index
break
}
}
WinSetSz(d, mp) {
global
local l, r, t, b
l := %mp%Left
r := %mp%Right
t := %mp%Top
b := %mp%Bottom
WinMove ahk_id %d%, , l, t, r - l + 1, b - t + 1
return
}
WinSuperMax(d, m) {
mp = G_MonWA%m% ; the text of the name of the pointer
WinSetSz(d, mp)
return
}
WinFullscreen(d, m) {
mp = G_MonFS%m%
WinSetSz(d, mp)
return
}
; Exclude the desktop
; Note: Also excludes "My Computer" browsing windows.
; Better detection might be needed to differentiate the parent explorer "ahk_id" from child windows.
; Also seems to disregard accidental Metro interface clicks (Win 8+).
; May wish to verify that not only is explorer not the active window, but it wasn't the clicked-in window.
#IfWinNotActive ahk_exe explorer.exe
LWIN & LButton::
RCtrl & LButton::
SetTitleMatchMode, 2
; monitor bounds and clicked window hwnd
cm = %A_CoordModeMouse% ; not autoset in older AHK, but shouldn't matter as default is Screen
CoordMode Mouse, Screen
MouseGetPos mpx, mpy, d ; was d := WinExist("A") but that would go for the active window, rather than the clicked-in-window
CoordMode Mouse, %cm%
MonGetCoords()
GetMon4xy(mpx, mpy, mpm)
; toggle the style
WinGet Style, Style, ahk_id %d%
; 0xC40000 = WS_BORDER (0x800000) + WS_DLGFRAME (0x400000) + WS_SIZEBOX or WS_THICKFRAME (0x040000)
if(Style & 0xC00000) { ; if has WS_CAPTION (WS_BORDER+WS_DLGFRAME) we want to supermax it
v%d%decs := Style & 0x040000 ; decorations, specifically WS_SIZEBOX
WinGet v%d%mm, MinMax, ahk_id %d% ; -1=min, 0=normal, 1=max
WinSet Style, -0xC40000, ahk_id %d% ; removes most window decoration, including WS_SIZEBOX if applicable
; if a "normal" window, get the coords and maximize. If minimized, maximize. If maximized, make sure correctly positioned
if(!v%d%mm) { ; normal window
WinGetPos v%d%x, v%d%y, v%d%w, v%d%h, ahk_id %d%
} if(v%d%mm < 1) { ; normal or minimized
WinMaximize ahk_id %d% ; set flag to maximized to preserve windows' restore button functionality upon un-supermax to maximized screen
}
WinSuperMax(d, mpm) ; it is now supermaximized. Now make sure it's positioned correctly
} else { ; it's super-maximized already, so need to restore it to former position.
if (v%d%decs) {
WinSet Style, +0xC40000, A ; set WS_SIZEBOX and WS_CAPTION
} else {
WinSet Style, +0xC00000, A ; set only WS_CAPTION
}
if(v%d%mm = 0) { ; not either previously Maximized nor previously Minimized
WinRestore ahk_id %d% ; restore standard window + set MinMax flag to non-maxxed
} else {
WinSuperMax(d, mpm) ; Maximized flag should still be set
}
}
WinSet Redraw
; ListVars
Return
如果您想要一个没有Windows UI且周围是黑色背景的窗口,即游戏,而游戏则什么也没有,那么为什么不以全屏模式运行?关于窗口模式的唯一问题是,如果您在后台运行另一个应用程序,那么在这种情况下Alt-Tab的性能会稍快一些?
如果正在播放的屏幕小于屏幕尺寸,并且没有干扰,那么(假定您使用的是LCD屏幕)您通常可以在游戏的全屏模式下运行,但分辨率略低而不是LCD的原始分辨率,那么许多LCD屏幕会在显示的屏幕周围带有黑色边框。