سؤال

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

هل كانت مفيدة؟

المحلول

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);
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top