Window Spy zeigt keinen ToolTip Titel an. Warum? Topic is solved

Stelle Fragen zur Programmierung mit Autohotkey

Moderator: jNizM

Rohwedder
Posts: 7623
Joined: 04 Jun 2014, 08:33
Location: Germany

Window Spy zeigt keinen ToolTip Titel an. Warum?

Post by Rohwedder » 14 Jul 2021, 10:32

Hallo,
ein Tooltipfenster hat zwar keine Titelleiste aber trotzdem einen Titel.

Code: Select all

q::
ToolTip, ToolTip-Text
WinGetTitle, Titel, ahk_class tooltips_class32
MsgBox,, der Titel des ToolTips lautet,% Titel
Return
Obwohl dieser Titel einfach zu ermitteln ist zeigt Window Spy ihn nicht an.
Bug or Feature?

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Window Spy zeigt keinen ToolTip Titel an. Warum?

Post by swagfag » 14 Jul 2021, 11:32

Code: Select all

...
actWin := WinExist("A") ; <<< set LastFoundWindow
if Ctrl_FollowMouse
{
	curWin := msWin
	curCtrl := msCtrl
	WinExist("ahk_id " curWin)
}
else
{
	curWin := actWin
	ControlGetFocus, curCtrl
}
WinGetTitle, t1 ; <<< get title of LastFoundWindow, which was an ACTIVE window
...
Bug or Feature?
cant activate a tooltip window. microsoft design
Last edited by swagfag on 15 Jul 2021, 04:34, edited 1 time in total.

Rohwedder
Posts: 7623
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Window Spy zeigt keinen ToolTip Titel an. Warum?

Post by Rohwedder » 15 Jul 2021, 03:45

But shouldn't it show the ToolTip title when "Follow Mouse" is enabled?

Code: Select all

...
actWin := WinExist("A") ; <<< set LastFoundWindow to be the ACTIVE window
if Ctrl_FollowMouse
{
	curWin := msWin
	curCtrl := msCtrl
	WinExist("ahk_id " curWin) ; <<< set LastFoundWindow to be the CURRENT window
}		
else
{
	curWin := actWin
	ControlGetFocus, curCtrl
}
WinGetTitle, t1 ; <<< get title of LastFoundWindow, which was the CURRENT or ACTIVE window
...

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Window Spy zeigt keinen ToolTip Titel an. Warum?  Topic is solved

Post by swagfag » 15 Jul 2021, 04:34

ok, so WinGetTitle uses GetWindowText(), which says
Copies the text of the specified window's title bar (if it has one) into a buffer. If the specified window is a control, the text of the control is copied. However, GetWindowText cannot retrieve the text of a control in another application.

If the target window is owned by another process and has a caption, GetWindowText retrieves the window caption text. If the window does not have a caption, the return value is a null string. This behavior is by design.
a tooltip doesnt have a caption and is in another process, so t1 := ""

Rohwedder
Posts: 7623
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Window Spy zeigt keinen ToolTip Titel an. Warum?

Post by Rohwedder » 15 Jul 2021, 10:28

Vielen Dank,
jetzt ist dies für mich plausibel. Das lag mir schon länger auf dem Magen!
Ein entsprechender Hinweis im Handbuch wäre hilfreich gewesen.

just me
Posts: 9450
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Window Spy zeigt keinen ToolTip Titel an. Warum?

Post by just me » 17 Jul 2021, 05:08

Moin,

für mich besteht ein möglicher Fehler eher darin, dass WinGetTitle für eigene ToolTip Controls den Text des ToolTips ausgibt. AHK ToolTips haben keinen Titel.

Post Reply

Return to “Ich brauche Hilfe”