主要是方便两个窗口对比查看
Win + q 窗口移动到左半边
Win + w 窗口移动到右半边
Shift + Win + q 窗口移动到上半边
Shift + Win + w 窗口移动到下半边
* 我的任务栏在屏幕左侧
#include<array.au3>
Global $g_width = @DesktopWidth, $g_height =@DesktopHeight, $g_taskbar_width = GetTrayWidth()
HotKeySet("#q", "MoveAndResizeToLeft")
HotKeySet("#w", "MoveAndResizeToRight")
HotKeySet("+#q", "MoveAndResizeToTop")
HotKeySet("+#w", "MoveAndResizeToBottom")
;;
;;
While 1
Sleep(100)
WEnd
;;
;;
Func GetTrayWidth()
Local $tray = WinGetHandle("[CLASS:Shell_TrayWnd]")
Local $pos = WinGetPos($tray)
Local $r = $pos[2] -2
Return $r
EndFunc
;;
;;
Func MoveAndResizeToLeft()
Local $t = MyGetActiveWinTitle()
WinMove($t,"",$g_taskbar_width,0, ($g_width - $g_taskbar_width)/2, $g_height )
EndFunc
;;
;;
Func MoveAndResizeToRight()
Local $t = MyGetActiveWinTitle()
WinMove($t,"",($g_width - $g_taskbar_width)/2 + $g_taskbar_width , 0,($g_width - $g_taskbar_width)/2,$g_height )
EndFunc
;;
;;
Func MoveAndResizeToTop()
Local $t = MyGetActiveWinTitle()
WinMove($t,"",$g_taskbar_width,0, $g_width - $g_taskbar_width, $g_height/2)
EndFunc
;;
;;
Func MoveAndResizeToBottom()
Local $t = MyGetActiveWinTitle()
WinMove($t,"",$g_taskbar_width, $g_height/2, $g_width-$g_taskbar_width, $g_height/2)
EndFunc
;;
;;
Func MyGetActiveWinTitle()
Local $list=WinList()
;_ArrayDisplay($list)
For $i=1 To $list[0][0]
If($list[$i][0] <> "" And WinIsActive($list[$i][0])) Then
Return $list[$i][0]
EndIf
Next
Return ""
EndFunc
;;
;;
Func WinIsActive($title)
If BitAND(WinGetState($title),8) then
Return 1
Else
Return 0
EndIf
EndFunc