Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdafx.h>
- #include <windows.h>
- #include <string.h>
- int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShow)
- {
- POINT pt = { 0 };
- HWND hwnd = NULL;
- char szTitle[256];
- for (;;)
- {
- hwnd = GetForegroundWindow();
- GetWindowTextA(hwnd, szTitle, sizeof(szTitle));
- if (0 != strcmp(szTitle, "GunsOfIcarusOnline"))
- {
- Sleep(50);
- continue;
- }
- if ((GetAsyncKeyState(VK_CONTROL) & 0x8000)
- || !(GetAsyncKeyState(VK_LBUTTON) & 0x8000))
- {
- Sleep(50);
- continue;
- }
- GetCursorPos(&pt);
- ScreenToClient(hwnd, &pt);
- SendMessage(hwnd, WM_LBUTTONDOWN, 0, MAKELONG(pt.x, pt.y));
- Sleep(10);
- SendMessage(hwnd, WM_LBUTTONUP, 0, MAKELONG(pt.x, pt.y));
- Sleep(10);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement