تسجيل الدخول

مشاهدة النسخة كاملة : SendInput() and MOUSEINPUT Problems



C++ Programming
08-06-2009, 09:41 AM
INPUT myInput;
myInput.type = INPUT_MOUSE;

MOUSEINPUT mouseInput;
mouseInput.dwFlags = MOUSEEVENTF_MOVE|MOUSEEVENTF_ABSOLUTE;
mouseInput.dx = 0;
mouseInput.dy = 690;
mouseInput.mouseData = 0;
mouseInput.time = 0;
mouseInput.dwExtraInfo = NULL;
myInput.mi = mouseInput;

SendInput(1, &myInput, sizeof(INPUT));


PROBLEM 1: The mouse is moved at the upper-left corner while through this code, I am requesting http://www.barakasoft.com/script/Forums/Images/smiley_laugh.gif him to move to BOTTOM-LEFT corner? Why this is not happening.


PROBLEM 2: I want to send event MOUSEEVENTF_RIGHTDOWN ( right button pressed at BOTTOM-LEFT), and request the system that please feel like as I click you at start buttonhttp://www.barakasoft.com/script/Forums/Images/smiley_frown.gif , but it is not accepting my command, I changed the flag to mouseInput.dwFlags=MOUSEEVENTF_RIGHTDOWN|MOUSEEVENTF_ABSOLUTE; So What is wrong ?