-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvrobot.v
More file actions
35 lines (22 loc) · 592 Bytes
/
vrobot.v
File metadata and controls
35 lines (22 loc) · 592 Bytes
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
module vrobot
#flag -lgdi32
#include "windows.h"
[typedef]
type COLORREF = int
fn C.mouse_event(int, int, int, int, int)
fn C.SetCursorPos(int, int)
fn C.GetCursorPos(point &Point) bool
fn C.GetDC(int) C.HDC
fn C.GetPixel(C.HDC, int, int) COLORREF
fn C.GetDesktopWindow() C.HWDC
fn C.ReleaseDC(C.HWDC, C.HDC) int
fn C.GetSystemMetrics(int) int
pub fn get_r_value(color COLORREF) int {
return color & 0xFF
}
pub fn get_g_value(color COLORREF) int {
return (color & 0xFF00) >> 8
}
pub fn get_b_value(color COLORREF) int {
return color >> 16
}