tags:

views:

848

answers:

2

I would like to be able to display some dynamic text at the mouse cursor location in a win32 app, for instance to give an X,Y coordinate that would move with the cursor as though attached. I can do this during a mousemove event using a TextOut() call for the window at the mouse coordinates and invalidate a rectange around a stored last cursor position to clear up the previous output. However this can suffer from flickering and cause problems with other things being drawn in a window such as tracker boxes. Is there a better way to do this, perhaps using the existing cursor drawing/invalidating mechanism ?

+2  A: 

You can do this via ToolTips - check out CToolTipCtrl.

If you want flicker free tracking ToolTips then you will need to derive your own classes from CToolTipCtrl that use the trackActivate messages.

graham.reeds
A: 

You may want to consider a small transparent window that you move to follow the mouse. In particular, since Windows 2000, Layered windows seem to be the weapon of choice (confession: no personal experience there).

Arkadiy