如果 Gui 跟随鼠标指针 Autohotkey,则鼠标左键单击不起作用
Left Mouse Click Not Work if Gui Follow The Mouse Pointer Autohotkey
如果 Gui 跟随鼠标指针自动热键,则鼠标左键单击无效。
我有一个 Ahk 脚本可以让我的带图片的 Gui 跟随鼠标指针。
但是鼠标左键点击不起作用。 (我可以 click/run 记事本,但我不能 select 记事本中的文本!)
我现在不明白为什么要那样做? (Gui+图片不在鼠标指针上。)
关注-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
尝试
Gui Show, x%x% y%y% NoActivate
NoActivate 避免停用当前活动的 window。
如果 Gui 跟随鼠标指针自动热键,则鼠标左键单击无效。
我有一个 Ahk 脚本可以让我的带图片的 Gui 跟随鼠标指针。
但是鼠标左键点击不起作用。 (我可以 click/run 记事本,但我不能 select 记事本中的文本!)
我现在不明白为什么要那样做? (Gui+图片不在鼠标指针上。)
关注-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
尝试
Gui Show, x%x% y%y% NoActivate
NoActivate 避免停用当前活动的 window。