Time is short, so I’ll answer half of it first. Getting the coordinates of the mouse pointer in the window is very simple. I used the WM_MOUSEMOVE message response function here. Let’s take a look at my sample window composition first:
The following tags are used to output the results. Then go directly to the code to see:
The above is about the mouse pointer issue. As for drawing on static, because it responds to OnPaint first, you cannot draw on static in OnPaint. You can use a timer to bypass this problem and complete static drawing in the Timer's event response function. Or derive your own static class from CStatic class and override
Time is short, so I’ll answer half of it first.
Getting the coordinates of the mouse pointer in the window is very simple. I used the WM_MOUSEMOVE message response function here. Let’s take a look at my sample window composition first:
The following tags are used to output the results. Then go directly to the code to see:
The above is about the mouse pointer issue.
As for drawing on static, because it responds to OnPaint first, you cannot draw on static in OnPaint. You can use a timer to bypass this problem and complete static drawing in the Timer's event response function. Or derive your own static class from CStatic class and override
This virtual function.