Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- #include <fstream>
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- POINT p;
- fstream file("a.txt", std::ios::out | std::ios::trunc);
- while (true) {
- if (GetAsyncKeyState(VK_LBUTTON)) {
- if (GetCursorPos(&p)) {
- file << p.x << "\n" << p.y << "\n";
- file << p.x << " " << p.y << endl;
- if (GetAsyncKeyState(VK_LBUTTON)) {
- cout << "LPM" << endl;
- file << "LPM" << endl;
- break;
- }
- if (GetAsyncKeyState(VK_RBUTTON)) {
- cout << "PPM" << endl;
- file << "PPM" << endl;
- break;
- }
- if (GetAsyncKeyState(VK_MBUTTON)) {
- cout << "SCROLL" << endl;
- file << "SCROLL" << endl;
- break;
- }
- }
- }
- /* COORD c;
- std::string x, y;
- file.open("file", std::ios::in);
- while (file >> x) {
- file >> y;
- SetCursorPos(std::stoi(x), std::stoi(y));
- Sleep(1000);
- }*/
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement