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.
Code:
; 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