【问题标题】:How to Show text on screen in AHK如何在 AHK 的屏幕上显示文本
【发布时间】:2018-05-05 13:53:01
【问题描述】:

我不是程序员,但我发现 AHK 很有用

目前我有一个小脚本来打开和关闭寡妇按钮(启用和禁用),我只需要添加一些文本来指示它是打开还是关闭,我现在找到了一个 GUI 脚本,它会写“ on”,但 id 什么也不做(所以 on 消息永远留在屏幕上)

我当前的脚本是:

PrintScreen::Send #{PrintScreen}
LWin::Return
RWin::Return

#If GetKeyState("CapsLock","T")
LWin::Send #{PrintScreen}
RWin::Send #{PrintScreen}
#If

f12::
Suspend
#SingleInstance, force

Gui, Color, White

Gui, -caption +toolwindow +AlwaysOnTop

Gui, font, s30 bold, Arial

Gui, add, text, vTX cRed TransColor, On

Gui, Show, % "x" A_ScreenWidth-300 " y" A_ScreenHeight-130 ,TRANS-WIN

WinSet, TransColor, White, TRANS-WIN

return



OnOff:  

    GuiControl, % (toggle := F12 ) ? "Hide" : "Show", TX

return

ExitApp



GuiEscape:

   ExitApp

return
return

你们能帮帮我吗?

【问题讨论】:

    标签: autohotkey


    【解决方案1】:

    经测试可以工作:

    PrintScreen::Send #{PrintScreen}
    LWin::
    RWin::Return
    
    #If GetKeyState("CapsLock","T")
        LWin::
        RWin::Send #{PrintScreen}
    #If
    
    F12::
        Suspend
        ShowOnOff()
    Return
    
    ShowOnOff() {
        Static TX
        If (TX = "") {
            Gui Color, White
            Gui -caption +toolwindow +AlwaysOnTop
            Gui font, s30 bold, Arial
            Gui add, text, vTX cRed TransColor, On
            Gui Show, % "x" A_ScreenWidth-300 " y" A_ScreenHeight-130, TRANS-WIN
            WinSet TransColor, White, TRANS-WIN
            TX := "On"
        } Else
            GuiControl % A_IsSuspended ? "Show" : "Hide", TX
    }
    

    【讨论】:

      猜你喜欢
      • 2017-10-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-02
      • 2019-06-18
      相关资源
      最近更新 更多