move and resize a application autohotkey

岁酱吖の 提交于 2019-12-11 15:26:34

问题


How can i Move and Resize a Application with Autohotkey Languages.

1 - i want to run a application, and then

2 - resize it in a Width Height Value,

3 - on the Windows Desktop with a position in a x y coordinate.

i Can run a Application and do a Autohotkey Keyboard Shortcut Macro to move the Window but How Can i Resize a Window With a Width Height Value.

the Autohotkey code so far, looks like this.

; [^ = Ctrl] [+ = Shift] [! = Alt] [# = Win] 

f5::
RunWait "C:\test.txt"
send !{space}m
send {left}
Mousemove 500,250
MouseClick left,0,0
return

回答1:


Look at the ahk documentation for WinWait and WinMove. The documentation for run gives details on storing the newly launched programs Process ID.

The below moves the window to 500x, 250y and resizes it to 200w x 100h.

f5::
run, C:\test.txt, , , o_pid
WinWait, ahk_pid %o_pid%
WinMove, ahk_pid %o_pid%, ,500, 250, 200, 100
return


来源:https://stackoverflow.com/questions/48049224/move-and-resize-a-application-autohotkey

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!