-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCursorPosition.cpp
More file actions
49 lines (39 loc) · 1.05 KB
/
CursorPosition.cpp
File metadata and controls
49 lines (39 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include<graphics.h>
#include<iostream>
#include<windows.h>
using namespace std;
int main()
{
initwindow(800,600);
POINT CursorPosition;
while(1)
{
GetCursorPos(&CursorPosition);
ScreenToClient(GetForegroundWindow(), &CursorPosition);
cout << "x: " << CursorPosition.x << " y: " << CursorPosition.y << endl;
// cout << CursorPosition.x << endl;
// cout << CursorPosition.y << endl;
if(GetAsyncKeyState(VK_LCONTROL)) {
bar(CursorPosition.x, CursorPosition.y, CursorPosition.x+50,
CursorPosition.y+50);
}
delay(5);
Sleep(5);
system("cls");
}
// while (1)
// {
// if (GetAsyncKeyState(VK_RBUTTON))
// {
// POINT pnt;
// GetCursorPos(&pnt);
// ScreenToClient(GetForegroundWindow(), &pnt);
//
// cout << "x: " << pnt.x << " y: " << pnt.y << endl;
//
// delay(5);
// Sleep(5);
// system("cls");
// }
// }
}