【问题标题】:how to move a program's window with ahk script?如何使用 ahk 脚本移动程序的窗口?
【发布时间】:2021-02-14 12:39:26
【问题描述】:

我正在尝试将程序的窗口移动到 0,0 位置,所以这是我的代码:

Run, C:\Program Files (x86)\ThunderSoft\DRM Protection\CPMaker.exe
WinMove, ahk_exe CPMaker.exe, , 0, 0

这是 Window Spy 的信息:

代码的第一行有效,但移动部分无效。我也试过ahk_class TfrmMain

【问题讨论】:

    标签: automation autohotkey ui-automation


    【解决方案1】:

    通过添加此行解决了问题:

    WinWait, ahk_exe CPMaker.exe, , 5
    

    这一行等待程序启动,第一个参数是WinTitle,最后一个参数是超时时间,以秒为单位。

    由于权限问题,代码仍然无法运行,所以我必须以管理员身份运行它,现在它可以运行了。

    【讨论】:

      猜你喜欢
      • 2018-01-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多