Autohotkey工具提示刷新

时间:2013-09-20 15:28:21

标签: autohotkey

一旦我通过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

1 个答案:

答案 0 :(得分:0)

您只需将工具提示更新放在gui按钮子程序

buttonok:
gui, submit
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%
return

像这样的东西

希望有所帮助