I have an ellipse which is drew on a window. I want to show a message when the pointer is on it (on the ellipse). How I do it? Is there any event for shapes? Like WM_MOVE or WM_SIZE.
I use TDM-GCC and C language.
On
When you draw on a device context, all knowledge of what shape you draw is lost, and the system just retains the pixel by pixel information of that device context. So there is no way for the system to give you any information about the shapes that you draw because it knows nothing of those shapes.
In order to do what you want you need to keep track in your program of the high level logic of where your shapes are. Then when you handle mouse messages you can map them onto your own data structures that represent the shapes.
There are no events for mouse activity over drawings. You are expected to remember where you draw, and then map the mouse coordinates to the drawing coordinates yourself. To help with this, have a look at the
PtInRegion()function. Create an ellipticalHRGNviaCreateEllipticRgn()orCreateEllipticRgnIndirect()that matches your drawing (in fact, you can use the sameHRGNto help facilitate the drawing, see theFillRgn()function), and when you want to test if the mouse is currently inside the drawing, such as in aWM_MOUSEMOVEhandler, you can usePtInRegion()for that.