Created
May 18, 2013 20:52
-
-
Save vlastachu/5605754 to your computer and use it in GitHub Desktop.
simulate mouse action on winapi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Windows.h> | |
#include <WinUser.h> | |
#include <iostream> | |
using namespace std; | |
int main(){ | |
//0..65535,0..65535 | |
int x =30000, y = 3000; | |
mouse_event(MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE, x, y, 0, 0); | |
mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0); | |
mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0); | |
cin >> x; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment