Question

I am writing a program to move mouse pointer using SetCursorPos() defined in windows.h . The parameters to SetCursorPos should be int. I have Point datastructure obtained from a rectangle. How to convert it? Thanks in advance :)

Was it helpful?

Solution

SetCursorPos defined as:

BOOL WINAPI SetCursorPos(
  _In_  int X,
  _In_  int Y
);

So you can use:

 Point p;
 ....some code
 SetCursorPos(p.x,p.y);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top