Skip to content

Instantly share code, notes, and snippets.

@vlastachu
Created May 18, 2013 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vlastachu/5605754 to your computer and use it in GitHub Desktop.
Save vlastachu/5605754 to your computer and use it in GitHub Desktop.
simulate mouse action on winapi
#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