設定視窗位置與大小的小工具 WinMove-ahk [AHK#44]

功能:讀取設定的 Ini 檔,依其設定調整應用程式的視窗位置與大小,並可移動到指定的虛擬桌面

使用方法

直接執行 WinMove-ahk.exe即可。

  1. 不傳參數:彈出輸入設定 ini 檔的對話窗,輸入後讀取ini以調整視窗
  2. 傳參數:有傳 Ini檔名 時直接執行,立即調整視窗
    winmove-ahk winset1.ini

可針對不同的螢幕設置多個 Ini 檔,依需要分別傳入以適應不同的螢幕解析度。

Ini 設定說明

  1. [Programs]裡指定要設定的應用程式,Count可自行調整
  2. 先用windowSpy.exe找到要設定的應用程式視窗,取其ahk_class或ahk_exe,設定成Find
  3. 分別指定視窗位置與大小,XY是視窗左上角的座標
    • WidthHeight為0或-1時表示最大化
  4. 可指定視窗顯示的虛擬桌面(desktop)與監視器(monitor,監視器尚未處理)
  5. 若要設定的程式未執行而要自動啟動,則設定Exec=應用程式執行檔路徑

WinSet1.ini 範例

; Using WindowSpy.ahk to get the required ahk_exe
; Programs entry is ahk_exe.
; ini entry is Case-senstive.
[Programs]
1=EmEditor
2=Explorer
3=MSWord
Count=3

[EmEditor]
Find=ahk_exe ee256.exe
X=100
Y=200
Width=1500
Height=600
Monitor=1
Desktop=1

; Windows Explorer
[Explorer]
Find=ahk_class CabinetWClass
X=500
Y=200
Width=800
Height=500
Monitor=1
Desktop=2

[MSWord]
Find=ahk_exe WINWORD.EXE
; if the specified app cannot be found, using Exec to execute it.
Exec=C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXE
X=0
Y=0
; width=0, height=0 means maximize
Width=0
Height=0
Monitor=1
Desktop=1

開放原始碼

教學影片

##

您可能也會有興趣的類似文章

簡睿

服務於軟體業的資訊老兵。興趣廣泛,學習力佳,樂於分享所知所學。

您可能也會喜歡…

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *