【问题标题】:How to execute an autohotkey script when launching a specific application启动特定应用程序时如何执行自动热键脚本
【发布时间】:2015-09-29 16:30:22
【问题描述】:

我已经成功地使用了自动热键脚本来实现我想要的(从窗口游戏中删除标题栏和窗口框架):

;-Caption
LWIN & LButton::
WinSet, Style, -0xC00000, A
return
;

;+Caption
LWIN & RButton::
WinSet, Style, +0xC00000, A
return
;

我想要的是在启动特定应用程序时自动执行“WinSet,Style,-0xC00000,A”。

任何反馈将不胜感激!

【问题讨论】:

    标签: windows fullscreen autohotkey titlebar


    【解决方案1】:

    尽管 wOxxOm 的回答完全可以接受。您也可以使用 Settimer 和 WinExist 在持久脚本中执行此操作。

    #persistent 
    
    SetTimer, isItRunning, 1000
    
    isItRunning: 
    if winexist("yourprogram")
         WinSet, Style, -0xC00000
    
    Return
    

    【讨论】:

    • winwait 在无限循环中会更好,原因有两个:[几乎] 即时反应并且没有不必要的代码运行(虽然在 AHK 的情况下不会太费力)。
    【解决方案2】:

    只需为游戏制作一个 AHK 启动器并使用它来代替快捷方式图标或任务栏图标或您用来启动游戏的任何其他东西。

    Run, d:\somepath\game.exe
    WinWait Game window title goes here
    WinSet, Style, -0xC00000
    ExitApp
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-03-20
      • 1970-01-01
      • 2017-06-11
      • 2013-12-23
      • 2018-07-02
      • 1970-01-01
      • 1970-01-01
      • 2017-02-02
      相关资源
      最近更新 更多