Archived

This topic is now archived and is closed to further replies.

How does windows determine when to call up a tooltip?

This topic is 5153 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How can windows tell that you''ve been hovering above an icon long enough to call the tooltip? Is there something similar to a mouseOver() windows function? //------------------------------------------------------------------------------------------------------ The great logician Bertrand Russell once claimed that he could prove anything if given that 1+1=1. So one day, some fool asked him, "Ok. Prove that you''re the Pope." He thought for a while and proclaimed, "I am one. The Pope is one. Therefore, the Pope and I are one."

Share this post


Link to post
Share on other sites
Don''t know how Windows does it, but here is a way of simulating the behavior (I''ve done as much in my game toolkit):

1) Have some means of knowing how the screen is divided up (that is, what ''zones'' or rectangles are being shown). For example, if you have your own control objects, you could keep a list of their bounding boxes.

2) Intercept the mouse move event (WM_MOUSEMOVE). Check to see if the mouse is in one of your ''zones''.

3) When the mouse moves into a zone, start a timer. When the timer goes off, a tooltip can be shown.

4) When a mouse moves out of a zone, stop the timer, if there is one.

5) Make sure to keep track if a tooltip is being shown. Then, in the mouse move handler, turn off any tooltip currently being shown.

Share this post


Link to post
Share on other sites