一旦通过 GUI 输入要显示的变量,我就无法更新工具提示。
有人可以运行这个脚本吗?您可以使用暂停键来打开编辑工具提示的菜单。
问题是我无法更新工具提示。工具提示显示了一些我不理解的代码。我发现它是另一个有助于阻止工具提示闪烁的线程。
edit9 = pre-saved F9
edit10 = pre-saved F10
edit11 = pre-saved F11
edit12 = pre-saved F12
ToolTip,F1: %edit1%`r`nF2: %edit2%`r`nF3: %edit3%`r`nF4: %edit4%`r`nF5: %edit5%`r`nF6: %edit6%`r`nF7: %edit7%`r`nF8: %edit8%`r`nF9 Databit: %edit9%`r`nF10 Geeks: %edit10%`r`nF11 ASI: %edit11%`r`nF12 Integrated Comp Sys: %edit12%, %mouseX%, %mouseY%, %mouseX%, %mouseY%
Gui, Destroy
Process,Exist
hwnd:=WinExist("ahk_class tooltips_class32 ahk_pid " Errorlevel)
Loop
ToolTip_UpdatePos(hwnd)
ToolTip_UpdatePos(hwnd,x="",y=""){
static TTM_TRACKPOSITION := 0x412
VarSetCapacity(xc, 20, 0), xc := Chr(20),DllCall("GetCursorInfo", "Uint", &xc)
,yc := NumGet(xc,16), xc := NumGet(xc,12),xc+=30,yc+=30
If x
xc:=x
If y
yc:=y
DllCall("SendMessage", A_PtrSize ? "UPTR" : "UInt", hwnd
, "Uint", TTM_TRACKPOSITION
, A_PtrSize ? "UPTR" : "UInt", 0
, A_PtrSize ? "UPTR" : "UInt", (xc & 0xFFFF)|(yc & 0xFFFF)<<16)
}
Pause::
GUI, destroy ;2nd loop will crash w/o this
SetTitleMatchMode, 2 ;Window must start with certain text
WinGetText, OutputVar, ConnectWise ; <--- A is active window
;msgbox %OutputVar%
gui, font, s10, Verdana
Gui, Add, Text, x6 y6 w150 h30, Text to display:
Gui, Add, Text, x6 y36 w150 h30, F1
Gui, Add, Edit, vedit1 x6 y56 w150 h25
Gui, Add, Text, x6 y86 w150 h30, F2
Gui, Add, Edit, vedit2 x6 y106 w150 h25
Gui, Add, Text, x6 y136 w150 h30, F3
Gui, Add, Edit, vedit3 x6 y156 w150 h25
Gui, Add, Text, x6 y186 w150 h30, F4
Gui, Add, Edit, vedit4 x6 y206 w150 h25
Gui, Add, Text, x6 y236 w150 h30, F5
Gui, Add, Edit, vedit5 x6 y256 w150 h25
Gui, Add, Text, x6 y286 w150 h30, F6
Gui, Add, Edit, vedit6 x6 y306 w150 h25
Gui, Add, Text, x6 y336 w150 h30, F7
Gui, Add, Edit, vedit7 x6 y356 w150 h25
Gui, Add, Text, x6 y386 w150 h30, F8
Gui, Add, Edit, vedit8 x6 y406 w150 h25
Gui, Add, Button, x61 y436 w40 h30, Ok
Gui, Show,, CW Info
return
buttonok:
gui, submit
return
F1::
SendPlay %edit1%
return
F2::
SendPlay %edit2%
return
F3::
SendPlay %edit3%
return
F4::
SendPlay %edit4%
return
F5::
SendPlay %edit5%
return
F6::
SendPlay %edit6%
return
F7::
SendPlay %edit7%
return
F8::
SendPlay %edit8%
return
F9::
SendPlay %edit9%
return
F10::
SendPlay %edit10%
return
F11::
SendPlay %edit11%
return
F12::
SendPlay %edit12%
return