Re: Trap MouseHover in Win32Lib
- Posted by euphoric (admin) Jul 10, 2010
- 978 views
DerekParnell said...
euphoric said...
I would like to trap a MouseHover event...
When you set a tooltip hint, you can supply a routine_id instead of some text. Then when Windows goes to display the tooltip, it calls your routine and displays whatever text your routine returns.
This means that you can write a routine that gets the mouse location, calculates which cell that's hovering over and return the text appropriate for that cell. Your routine will receive two parameters; the ID that invoked the tooltip and the maximum length for the tip text.
I tried this route. Two problems:
- It doesn't call the tooltip routine again until the mouse is moved off the control, then back to it. I need to hit it for each stopping point, not just the first. If I hover over column 2, then hover over column 5, the tooltip generated over column 2 remains.
- The routine called by the tooltip feature lets me get the mouse coordinate, but I don't know how to translate that coordinate into a column of the EuGrid.
Any ideas?