Hello, AutoIt People!
I've about pulled out my hair trying to capture the text of tooltips from an application not created from AutoIt. I have looked at all the documentation, Google searches, endless tries, failures across the board.
WinActivate($sTitle) MouseMove(512, 224, 1) ;over the control Sleep(3000) ;display tooltip $hWnd = ControlGetHandle($sTitle, "", 2502) ConsoleWrite(_GUIToolTip_ToolExists($hWnd) & @lf) ;comes back false $hTool = WinGetHandle($sTitle) ;handle of window containing control ; how do you get the $iID $arr = _GUIToolTip_GetToolInfo($hWnd, $hTool, $iID) ;$iID How do you get the Identifier of the tool?
I'm at a complete loss.
Maximized Windows in Windows 10 usually (for me) don't show tooltips or hints. For a short time following a WIndows update this was fixed on my laptop but after another day, and maybe another update, the problem returned, so I don't understand what the conditions are.
The script below checks for maximized windows and sets their size to a few pixels less than the screen size and this brings back tooltips.
I have found another way to fix the problem which might help some people. There are several programs I use regularly and the tooltips are important. On the programs I compile the tooltips help my users if they are not familiar with using the programs. If I set the maximum window size to be greater than the screen size ( @DesktopHeight/@Desktopwidth) then when maximized it still fits the screen ok but the tooltips still work. This can be done in AUtoIt with
GUIRegisterMsg($WM_GETMINMAXINFO, "MY_WM_GETMINMAXINFO")---- (search for examples)
In Delphi it can be done with Form.Constraints. I don't know about other languages.
For apps where the maximum size can't be controlled the script below could help someone; it helps me at least.
Const $SPI_SETWORKAREA = 47, $SPI_GETWORKAREA = 48, $SPIF_SENDCHANGE = 11 $StartRect = DllStructCreate("int") $PStartRect = DllStructGetPtr($StartRect) $res = DllCall("user32.dll", "int", "SystemParametersInfo", "int", $SPI_GETWORKAREA, "int", 0, "ptr", $PStartRect, "int", 0) $maxwid = DllStructGetData($StartRect, 1, 3) - DllStructGetData($StartRect, 1, 1) $maxht = DllStructGetData($StartRect, 1, 4) - DllStructGetData($StartRect, 1, 2) While 1 $aList = WinList() $res = DllCall("user32.dll", "int", "SystemParametersInfo", "int", $SPI_GETWORKAREA, "int", 0, "ptr", $PStartRect, "int", 0) $maxwid = DllStructGetData($StartRect, 1, 3) - DllStructGetData($StartRect, 1, 1) $maxht = DllStructGetData($StartRect, 1, 4) - DllStructGetData($StartRect, 1, 2) For $i = 1 To $aList If $aList[$i] <> 'Program Manager' Then $ws = WinGetPos($aList[$i]) if isarray($ws) then;for some reason it isn't always If $aList[$i] <> "" And $ws > $maxwid And $ws > $maxht Then WinSetState($aList[$i], '', @SW_RESTORE);because changing the size leaves it as maximised as far as Windows is concerned! WinMove($aList[$i], '', $ws,$ws, $maxwid, $maxht) Endif EndIf EndIf Next Sleep(5000) WEnd
25th January 2016. WIndows 10 had a major update overnight on my PC. Now the problem with missing tooltips has gone. I din't know Microsoft studied these forums so carefully. So this means this script is no longer needed by me or anyone else.
24 Jan 2016 Edit again after Argumentum pointed out more than one monitor not allowed for. Not certain this is still correct but will test it with another monitor during next few days.
24th Jan 2016 Improved to use working area of desktop because the Taskbar and other apps can use up some of the desktop, so a maximised window is not necessarily to desktop size. (I tried testing for @Maximized but it failed, and I didn't spend any time worying about why though it would be better.)