Mouse cursor doesn't update

Using OpenCV and CVUI(GUI) and had a question though I know this board is primarily OpenCV. In case no one knows the CVUI angle, I have a c++ solution after the code::

So in the following loop the mouse cursor object doesn’t update:

int mode_number = 2;

while(mode_number == 2)
                                       cv::Point cursor = cvui::mouse();
					double mouse_x = cursor.x, mouse_y = cursor.y;
					std::cout << mouse_x << "," << mouse_y << std::endl;

Non-CVUI: C++:This works on getting the cursor position:

					if (GetCursorPos(&p))
						std::cout << p.x << "," << p.y << std::endl;
						//cursor position now in p.x and p.y

But how do I retrieve the positions relative to the window I am in, not as a whole?

This is an OpenCV related forum, we can’t give any advice concerning third-party libraries like CVUI (even if they are based on OpenCV…)