TargetWin = Test Window ; Generated using SmartGUI Creator 3.4 Gui, Add, Button, x16 y17 w60 h30, Button Gui, Add, Checkbox, x16 y57 w70 h30, Checkbox Gui, Add, Edit, x116 y17 w140 h70, Edit Gui, Show, x158 y318 h103 w269, %TargetWin% SetTimer, Tip, 2000 Return GuiClose: ExitApp Tip: IfWinNotActive, %TargetWin% { ToolTip Return } MouseGetPos,,,, ACtrl Tip = If ACtrl = Button1 Tip = A Button If ACtrl = Button2 Tip = A Checkbox If ACtrl = Edit1 Tip = My Edit field If ACtrl <> %LastCtrl% { ToolTip, %Tip% LastCtrl = %ACtrl% } Return
Tooltip for help on control under mouse
Started by
Rajat
, Mar 21 2005 01:04 PM
1 reply to this topic
This simple example function will show a configurable helpful tooltip for control under mouse cursor.
#1
-
Posted 21 March 2005 - 01:04 PM
CleanNews.in : Bite sized latest news headlines from India with zero bloat
Thank you for the script. Is there a way to use the window handle (HWND) of each control rather than the ControlNN?
Solution:
Micahs's script is useful. Modified code below.
Solution:
Micahs's script is useful. Modified code below.
; requires getClassNN() from http://www.autohotkey.com/forum/viewtopic.php?t=20099&highlight=classnn+hwnd ; Note: ControlNN(variable_name_of control) does not work. TargetWin = Test Window Gui, Add, Button, x16 y17 w60 h30 HWNDbutton_hwnd, Button Gui, Add, Checkbox, x16 y57 w70 h30, Checkbox example Gui, Add, Edit, x116 y17 w140 h70 vedit_me, Edit Gui, Show, x158 y318 h103 w269, %TargetWin% SetTimer, Tip, 2000 Return GuiClose: ExitApp Tip: IfWinNotActive, %TargetWin% { ToolTip Return } MouseGetPos,,,, ACtrl Tip = If (ACtrl == getClassNN(button_hwnd)) { Tip = Works using control's HWND } If (ACtrl == getClassNN("Checkbox example")) { Tip = Works using control's caption } If (ACtrl == "Edit1") { Tip = Works using control's ControlNN } If ACtrl <> %LastCtrl% { ToolTip, %Tip% LastCtrl = %ACtrl% } Return
#2
-
Posted 07 November 2009 - 02:22 PM