【问题标题】:Left Mouse Click Not Work if Gui Follow The Mouse Pointer Autohotkey如果 Gui 跟随鼠标指针自动热键,鼠标左键单击不起作用
【发布时间】:2019-07-09 11:27:48
【问题描述】:

如果 Gui 跟随鼠标指针自动热键,鼠标左键单击不起作用。

我有一个 Ahk 脚本,可以让我的带有图片的 Gui 跟随鼠标指针。

但是鼠标左键不起作用。 (我可以点击/运行记事本,但我不能在记事本中选择文本!)

我现在不知道为什么它会那样做? (Gui+图片不在鼠标指针上。)

Follow-Pointer.ahk

#SingleInstance force 
CoordMode, Mouse, screen 
CoordMode, ToolTip, screen 
IfNotExist, c5sc29f.gif ;c5sc29f.gif File is roket.gif 
   URLDownloadToFile, https://i.imgur.com/c5sc29f.gif, c5sc29f.gif 
Gui -Caption +LastFound +ToolWindow +AlwaysOnTop 
Gui, Margin, 0, 0 
Gui, Color, FFFFFF 
Gui, Add, Picture, x100 y100 w-1 h50 +BackgroundTrans, c5sc29f.gif ;
;WinSet, Transcolor, FFFFFF 
WinSet, ExStyle, +0x20  ; set click through style 
gosub, F1 
return 

F1:: SetTimer Draw, % (switch:= !switch) ? "20" : "-20" 

Draw: 
   MouseGetPos, x, y 
   y+=10, x+=10 
   If switch {
      Gui Show, x%x% y%y% 
      ;~ ToolTip,%  "x" x " y" y,% x+0,% y+50
   } else {
      Gui Cancel 
      ToolTip,
   }
return 

esc::ExitApp 
ExitApp

return

【问题讨论】:

    标签: autohotkey


    【解决方案1】:

    试试

    Gui Show, x%x% y%y% NoActivate
    

    NoActivate 避免停用当前活动的窗口。

    【讨论】:

    • 很好用,谢谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-13
    • 1970-01-01
    • 2017-11-04
    • 1970-01-01
    相关资源
    最近更新 更多