README.md
December 4, 2022 ยท View on GitHub
Description
Moves the mouse cursor down your screen and prints the coordinates.
More Info
| Submitted On | |
| By | michael coder |
| Level | Beginner |
| User Rating | 4.0 (24 globes from 6 users) |
| Compatibility | C++ (general), Microsoft Visual C++, Borland C++ |
| Category | System Services/ Functions |
| World | C / C++ |
| Archive File |
API Declarations
#include <iostream>
#include <windows.h>
using namespace std;
Source Code
#include <iostream>
#include <windows.h>
using namespace std;
int main(){
bool on=false;
cout<<"Heavy Mouse by mike\nTo exit press F11\n";
Sleep(4000);
while (1){
Sleep(1);
POINT pos;
GetCursorPos(&pos);
int x=pos.x;
int y=pos.y;
Sleep(10);
SetCursorPos(x,y+1);
if(GetAsyncKeyState(VK_F11)<0){
break;
}
cout<<"x="<<x<<" y="<<y<<"\n";
}
return 1;
}