需求:上一个窗口设置文档,发现如果还有其他大小的需求的话,发现键位根本不够用,现在了个通过GUI界面方便多了。也可以通过这个为模板案例,学习一下如何使用AHK的GUI。
首先,界面下图所示。
每次使用完,会自动销毁窗口,功能主要是偶尔四个选区工作的要求
;=========================================================
#w:: ;加上&号是为了添加快捷键,和win右键菜单逻辑是一样的
Gui, Destroy
Gui +AlwaysOnTop
Gui Add, Button, gChoiceA w100, 左上&1
Gui Add, Button, gChoiceB w100, 右上&2
Gui Add, Button, gChoiceC w100, 左下&3
Gui Add, Button, gChoiceH w100, 右下&4
Gui Add, Button, gChoiceD w100, 居中(&q)
Gui Add, Button, gChoiceE w100, 居中(&w)
Gui, Show, AutoSize Center
Return
;设置快捷键esc退出
GuiEscape:
gui,destroy
return
ChoiceA:
gui,destroy
WinMove, A, , 100, 0,1250, 700
Return
ChoiceB:
gui,destroy
winmove, a, , 1350, 0, 1200, 700
Return
ChoiceC:
gui,destroy
winmove, a, , 100, 750, 1250, 700
Return
ChoiceH:
gui,destroy
winmove, a, , 1350, 750, 1200, 700
Return
ChoiceD:
gui,destroy
winmove, a, , 550, 120, 1600, 1150
return
ChoiceE:
gui,destroy
winmove, a, , 220, 50, 2100, 1300
return