954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

MFC : Mouse Coordinates Problem

void CScreenCoordDlg::OnMouseMove(UINT nFlags, CPoint p)
{
       GetCursorPos(&p);
       m_ValX = p.x;
       m_ValY = p.y;
       UpdateData(FALSE);
}


I used the following code to get the mouse coordinates on mouse move.
But the problem is as soon as the mouse moves out of the dialog window it stops updating the mouse coordinates.
Although it shows the mouse coordinates with respect to the top left of the screen ,i.e, (0,0), when inside the dialog window, I want the program to work globally, that is, when the mouse is outside the window it should update the coordinates.

Where's the problem, what should be done to overcome it?

I use MFC Visual Studio 2008.

Kunal Aggarwal
Newbie Poster
13 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: