算是半个自制吧
参考了一些网站上提供的之前的老旧代码
但是也加了一些自己改的东西
#WheelUp::
和#WheelDown::
:
- 功能:使用
Win + 鼠标滚轮向上/向下
组合键,可以等比例地增加或减少当前活动窗口的宽度和高度。
#+WheelUp::
和#+WheelDown::
:
- 功能:使用
Win + Shift + 鼠标滚轮向上/向下
组合键,控制高度
#!WheelUp::
和#!WheelDown::
:
- 功能:使用
Win + Alt + 鼠标滚轮向上/向下
组合键,控制宽度
; 今天修复了这个版本。 增加了一些单独控制宽和长的功能
#WheelUp::
#+WheelUp::
#!WheelUp::
#WheelDown::
#+WheelDown::
#!WheelDown::
GetKeyState, SIZ_AltState, Alt, P
If ( NWD_Dragging or NWD_ImmediateDown )
Return
SetWinDelay, -1
CoordMode, Mouse, Screen
IfWinActive, A
{
WinGet, SIZ_WinID, ID
If ( !SIZ_WinID )
Return
WinGetClass, SIZ_WinClass, ahk_id %SIZ_WinID%
If ( SIZ_WinClass = "Progman" )
Return
GetKeyState, SIZ_CtrlState, Ctrl, P
WinGet, SIZ_WinMinMax, MinMax, ahk_id %SIZ_WinID%
WinGet, SIZ_WinStyle, Style, ahk_id %SIZ_WinID%
If ( (SIZ_CtrlState = "D") or ((SIZ_WinMinMax != 1) and (SIZ_WinStyle & 0x40000)) )
{
WinGetPos, SIZ_WinX, SIZ_WinY, SIZ_WinW, SIZ_WinH, ahk_id %SIZ_WinID%
If ( SIZ_WinW and SIZ_WinH )
{
SIZ_AspectRatio := SIZ_WinW / SIZ_WinH
IfInString, A_ThisHotkey, WheelDown
SIZ_Direction = 1
Else
SIZ_Direction = -1
SIZ_Factor1=1
SIZ_Factor2=1
IfInString, A_ThisHotkey, +
SIZ_Factor1 = 0 ; shift010203
IfInString, A_ThisHotkey, !
SIZ_Factor2 = 0 ; shift010203
SIZ_WinNewW := SIZ_WinW + SIZ_Direction *100 *SIZ_Factor1 ;* SIZ_WinW
SIZ_WinNewH := SIZ_WinH + SIZ_Direction *100 *SIZ_Factor2 ;* SIZ_WinH
If ( SIZ_WinNewW > A_ScreenWidth )
{
SIZ_WinNewW := A_ScreenWidth
SIZ_WinNewH := SIZ_WinNewW / SIZ_AspectRatio
}
If ( SIZ_WinNewH > A_ScreenHeight )
{
SIZ_WinNewH := A_ScreenHeight
SIZ_WinNewW := SIZ_WinNewH * SIZ_AspectRatio
}
SIZ_WinNewX := SIZ_WinX ;+ (SIZ_WinW - SIZ_WinNewW) / 2
SIZ_WinNewY := SIZ_WinY ;+ (SIZ_WinH - SIZ_WinNewH) / 2
Transform, SIZ_WinNewX, Round, %SIZ_WinNewX%
Transform, SIZ_WinNewY, Round, %SIZ_WinNewY%
Transform, SIZ_WinNewW, Round, %SIZ_WinNewW%
Transform, SIZ_WinNewH, Round, %SIZ_WinNewH%
WinMove, ahk_id %SIZ_WinID%, , SIZ_WinNewX, SIZ_WinNewY, SIZ_WinNewW, SIZ_WinNewH
}
}
}