Ok so I've been looking at keeping track of my cursor coordinates on my main window. GetCursorPos() returns a pointer to a POINT struct that holds x and y coordinates. In order to separate this, I will need to do something like?
1 2 3 4
POINT * ptr = GetCursorPos()
POINT points = *ptr;
xCoord = points.x;
yCoord = points.y;
POINT curPos;
BOOL result = GetCursorPos(&curPos);
if (result)
{
//The function call succeeded and curPos has valid data.
}
else
{
//The function call failed and you cannot rely on the information in curPos.
}
Note that BeginPaint/EndPaint should only be used when painting (ie: WM_PAINT) because they only redraw invalidated/dirty areas.
If you are drawing outside of the normal paint, then you'd want GetDC/ReleaseDC like naraku suggested.
Although that has its own problems. For example if you click to display that text, then drag another window over your main window, then flip back to your program, the text will be gone. The window needs to be repainted when something goes over it. Windows sends a WM_PAINT message when that happens, which is one of the reasons why it's best to keep your drawing code in WM_PAINT.