Hi Flipdeador,
I hope you don't mind me posting this in English. My Spanish is not that good.
I studied your class carefully as I am trying to learn more about how tooltips are handled and I found a problem with your class, specifically in the
GetPos() method. The script below demonstrates the issue:
Code: Select all
F3::
TT := New _ToolTip()
CoordMode("Mouse")
MouseMove(SysGet(78)-50, A_ScreenHeight//2, 0) ; Move close to the right edge of the virtual screen
TT.Show("My ToolTip Text")
Return
As you can see the tooltip "runs over" the edge of the virtual screen. The code in the
Show() method tries to prevent that from happening. The issue seems to be with the
TTM_GETBUBBLESIZE message (0x041E). If it's called before the tooltip is activated via the
TTM_TRACKACTIVATE message (0x0411), it returns incorrect values for the width (14) and height (6) of the tooltip. This
post seems to suggest that it's possible to get the size of the tooltip before it's activated but I wasn't able to figure out how to do it.
I look forward to your ideas on a possible solution.
Cheers!
- iPhilip