Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- int main() {
- POINT p;
- int speed = 2;
- HWND asd = GetDesktopWindow();
- HDC aaa = GetDC(asd);
- COLORREF clr = RGB(0,0,250);
- while (true) {
- GetCursorPos(&p);
- if(GetAsyncKeyState(VK_LEFT))
- p.x -= speed;
- if(GetAsyncKeyState(VK_RIGHT))
- p.x += speed;
- if(GetAsyncKeyState(VK_UP))
- p.y -= speed;
- if(GetAsyncKeyState(VK_DOWN))
- p.y += speed;
- if(GetAsyncKeyState(VK_END))
- break;
- if(GetAsyncKeyState(VK_NEXT)) {
- //mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
- SetPixel(aaa, p.x, p.y, clr);
- SetPixel(aaa, p.x+1, p.y+1, clr);
- }
- if(GetAsyncKeyState(VK_NUMPAD1))
- clr = RGB(0,255,0);
- if(GetAsyncKeyState(VK_NUMPAD2))
- clr = RGB(255,0,0);
- if(GetAsyncKeyState(VK_NUMPAD3))
- clr = RGB(150,0,100);
- SetCursorPos(p.x, p.y);
- Sleep(3);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment