Cursor info box text
Any ideas?
MouseGetPos
ToolTip
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
#I am interested in a solution, too. :?
I can get the class of a tooltip.
I can use the class to change the Windows Title of a Tooltip.
But I couldn`t see any controls within a Tooltip_Window, so I found no way to retreive the text of a Tooltip.
Does anybody know, how to retrieve text from a Tooltip_Window?
If you intend to access a ToolTip created by a process other than your own, it will likely require remote memory access.
Read this thread: Can Autohotkey capture tooltip text?Does anybody know, how to retrieve text from a Tooltip_Window?
2) Intuitive. Logical. Versatile. Adaptable. <
Read this thread: Can Autohotkey capture tooltip text?
You're right. I just tested ControlGetText against a ToolTip with a title, and it does retrieve the text. I wasn't sure what it would retrieve in that case.
CoordMode, ToolTip, Screen ToolTip, hello`, world, 50, 50 Sleep, 100 WinGet, hw_tt, ID, ahk_class tooltips_class32 SendMessage, 0x400+32, 1, "the title",, ahk_id %hw_tt% ;MsgBox, %ErrorLevel% SendMessage, 0x400+29,,,, ahk_id %hw_tt% Sleep, 100 WinGetTitle, title, ahk_id %hw_tt% ControlGetText, text,, ahk_id %hw_tt% MsgBox, %title%`n`n%text%
grr, should have searched the Forum, thanks Declaro110!Read this thread: Can Autohotkey capture tooltip text?Does anybody know, how to retrieve text from a Tooltip_Window?
@shimanov
Your script-example is working well. I think, my problem is, that I reached the borders of AHK, now I need to understand, how WindowsXp works. Dllcalls and SendMessages are books with seven seals for me. So I will do Rajats Send-tutorial, now, have a nice weekend :wink:
I reached the borders of AHK
Fortunately, with SendMessage and DllCall, those borders have a low threshold. And within the borders, you are mostly limited by your own creativity, as many in this community have aptly demonstrated.
So I will do Rajats Send-tutorial
That is a good resource and you should consider complementing that tutorial with Microsoft's own Windows 2000/XP/etc. SDK (Software Development Kit), which includes documentation, header files, and more. This is where you will find the API documented, as well as, the codes for SendMessage/PostMessage, DllCall, etc.
now, have a nice weekend :wink:
Thank you.
It seems, that the tool-tips generated by browsers with their OnMousover-command do not use the Windows Tooltip-Structures.
here the Test-script: (Press F1 to start script)
F1:: DetectHiddenWindows, On DetectHiddenText, On Total_info = WinGet, id, list, ahk_class tooltips_class32 Loop, %id% { StringTrimRight, this_id, id%a_index%, 0 ControlGetText, OutputVar,,ahk_id %this_id% WinGetTitle, this_title, ahk_id %this_id% Total_info := Total_info . "`tFensterID `t" . id%a_index% . "`tTitel`t" . this_title . "`tText`t" . OutputVar . "`n" id%a_index% = } id0 = gui, destroy Gui, Add, Text,, %Total_info% gui, show, All_Tooltip_Dispay Total_info = Control, Style, 0x200000, static1, All_Tooltip_Dispay return@shimanov
had a look for the TTM_GETTEXT Message
my problem is this part of the message:
I am not sure, what to do with this Info, I think I will have to do something with this structure first. Somewhere in the Forum I read, that it should be nearly impossible to read a structure with AHK. But I also saw this Article by corruptlptilResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_GETTEXT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTOOLINFO) lpti;
);
Pointer to a TOOLINFO structure. The cbSize member of this structure must be filled in before sending this message. Set the hwnd and uId members to identify the tool for which to retrieve information. Set the lpszText member to point to a buffer that receives the text. There currently is no way to specify the size of the buffer or to determine the required buffer size.
http://www.autohotke... ... =structure
Is this the solution to the problem with reading structures?
Pointer to a TOOLINFO structure. The cbSize member of this structure must be filled in before sending this message. Set the hwnd and uId members to identify the tool for which to retrieve information. Set the lpszText member to point to a buffer that receives the text.
Review the following:
There is one missing statement, that is the value for uId. I have not tested it.
The uID member of the TOOLINFO structure is defined by the application.
...
When you add a tool implemented as a window, the uID member of the TOOLINFO structure must contain the window handle to the tool. Also, the uFlags member must specify the TTF_IDISHWND value, which tells the ToolTip control to interpret the uID member as a window handle.
ti_size = 44 VarSetCapacity( ti, ti_size ) text_size = 100 VarSetCapacity( text, text_size ) buffer := Chr( 44 ) InsertInteger( wid, ti, 8 ) ; InsertInteger( id, ti, 12 ) InsertInteger( &text, ti, 36 ) SendMessage, TTM_GETTEXT, 0, &ti,, ahk_id %wid%
But I also saw this Article by corrupt
http://www.autohotke... ... =structure
Is this the solution to the problem with reading structures?
It is a start. However, it may be sufficient for the present task. You could also use Chris's "ExtractInteger" from the DllCall page.
somebody kowns how to do it in C++ ? ( Windows)
with TTM_GETTEXT i suppose...
thanks