Do you want to get the mouse coordinates outside of your window? Or do you want
to convert the screen coordinates to client coordinates? If so, controls have
PointToScreen() and PointToClient() methods.
If the later, you can use:
[DllImport("user32.dll")]
static extern bool GetCursorPos(ref Point lpPoint);
Point defPnt = new Point();
// Call the function and pass the Point, defPnt
GetCursorPos(ref defPnt);
// Now after calling the function, defPnt contains the coordinates
which we can read
string x = defPnt.X.ToString();
string y = defPnt.Y.ToString();