Domanda

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 :)

È stato utile?

Soluzione

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);
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top