Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define WINVER 0x0500
- #include <Windows.h>
- #include <iostream>
- #include <string>
- using namespace std;
- int main () {
- POINT pt;
- bool hey;
- hey = false;
- int delay;
- HWND hwnd;
- cout << "delay: ";
- cin >> delay;
- while (0==0) {
- if (GetAsyncKeyState(VK_HOME)) {
- hey = true;
- cout << "activated" << endl;
- }
- while (hey==true) {
- hwnd = GetForegroundWindow();
- Sleep(4);
- if (GetAsyncKeyState(VK_END)) {
- hey = false;
- cout << "deactivated" << endl;
- }
- while (GetAsyncKeyState(VK_LBUTTON)) {
- GetCursorPos(&pt);
- SendMessage(hwnd, WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(pt.x,pt.y));
- Sleep(delay);
- SendMessage(hwnd, WM_LBUTTONUP, 0, MAKELPARAM(pt.x,pt.y));
- Sleep(delay);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement