-
Notifications
You must be signed in to change notification settings - Fork 1
/
background.go
174 lines (142 loc) · 4.36 KB
/
background.go
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
package gdm
import (
"github.com/rogeecn/draw"
"github.com/rogeecn/gdm/utils"
)
const (
DISPLAY_NORMAL = "normal"
DISPLAY_GDI = "gdi"
DISPLAY_GDI2 = "gdi2"
DISPLAY_DX2 = "dx2"
DISPLAY_DX3 = "dx3"
DISPLAY_DX = "dx"
)
const (
MOUSE_NORMAL = "normal"
MOUSE_WINDOWS = "windows"
MOUSE_WINDOWS2 = "windows2"
MOUSE_WINDOWS3 = "windows3"
MOUSE_DX = "dx"
MOUSE_DX2 = "dx2"
)
const (
KEYPAD_NORMAL = "normal"
KEYPAD_WINDOWS = "windows"
KEYPAD_DX = "dx"
)
const (
MODE_0 = 0
MODE_2 = 2
MODE_11 = 11
MODE_13 = 13
MODE_101 = 101
MODE_103 = 103
)
func (com *DmSoft) BindWindow(hwnd int, display string, mouse string, keypad string, mode int) bool {
ret, _ := com.dm.CallMethod("BindWindow", hwnd, display, mouse, keypad, mode)
return utils.IsOK(ret.Val)
}
func (com *DmSoft) BindWindowEx(hwnd int, display string, mouse string, keypad string, public string, mode int) bool {
ret, _ := com.dm.CallMethod("BindWindowEx", hwnd, display, mouse, keypad, public, mode)
return utils.IsOK(ret.Val)
}
func (com *DmSoft) DownCPU(rate int) bool {
ret, _ := com.dm.CallMethod("DownCpu", rate)
return utils.IsOK(ret.Val)
}
func (com *DmSoft) EnableBind(enable int) bool {
ret, _ := com.dm.CallMethod("EnableBind", enable)
return utils.IsOK(ret.Val)
}
func (com *DmSoft) EnableFakeActive(enable int) bool {
ret, _ := com.dm.CallMethod("EnableFakeActive", enable)
return utils.IsOK(ret.Val)
}
func (com *DmSoft) EnableIme(enable int) bool {
ret, _ := com.dm.CallMethod("EnableIme", enable)
return utils.IsOK(ret.Val)
}
func (com *DmSoft) EnableKeypadMsg(enable int) bool {
ret, _ := com.dm.CallMethod("EnableKeypadMsg", enable)
return utils.IsOK(ret.Val)
}
func (com *DmSoft) EnableKeypadPatch(enable int) bool {
ret, _ := com.dm.CallMethod("EnableKeypadPatch", enable)
return utils.IsOK(ret.Val)
}
func (com *DmSoft) EnableKeypadSync(enable, timeOut int) bool {
ret, _ := com.dm.CallMethod("EnableKeypadSync", enable, timeOut)
return utils.IsOK(ret.Val)
}
func (com *DmSoft) EnableMouseMsg(enable int) bool {
ret, _ := com.dm.CallMethod("EnableMouseMsg", enable)
return utils.IsOK(ret.Val)
}
func (com *DmSoft) EnableMouseSync(enable, timeOut int) bool {
ret, _ := com.dm.CallMethod("EnableMouseSync", enable, timeOut)
return utils.IsOK(ret.Val)
}
func (com *DmSoft) EnableRealKeypad(enable int) bool {
ret, _ := com.dm.CallMethod("EnableRealKeypad", enable)
return utils.IsOK(ret.Val)
}
func (com *DmSoft) EnableRealMouse(enable, mousedelay, mousestep int) bool {
ret, _ := com.dm.CallMethod("EnableRealMouse", enable, mousedelay, mousestep)
return utils.IsOK(ret.Val)
}
func (com *DmSoft) EnableSpeedDx(enable int) bool {
ret, _ := com.dm.CallMethod("EnableSpeedDx", enable)
return utils.IsOK(ret.Val)
}
func (com *DmSoft) ForceUnBindWindow() bool {
ret, _ := com.dm.CallMethod("ForceUnBindWindow")
return utils.IsOK(ret.Val)
}
func (com *DmSoft) GetBindWindow() bool {
ret, _ := com.dm.CallMethod("GetBindWindow")
return utils.IsOK(ret.Val)
}
func (com *DmSoft) GetFps() int {
ret, _ := com.dm.CallMethod("GetFps")
return int(ret.Val)
}
func (com *DmSoft) HackSpeed(rate int) int {
ret, _ := com.dm.CallMethod("HackSpeed", rate)
return int(ret.Val)
}
func (com *DmSoft) IsBind(hwnd int) bool {
ret, _ := com.dm.CallMethod("IsBind", hwnd)
return utils.IsOK(ret.Val)
}
func (com *DmSoft) LockDisplay(lock int) bool {
ret, _ := com.dm.CallMethod("LockDisplay", lock)
return utils.IsOK(ret.Val)
}
func (com *DmSoft) LockInput(lock int) bool {
ret, _ := com.dm.CallMethod("LockInput", lock)
return utils.IsOK(ret.Val)
}
func (com *DmSoft) LockMouseRect(r *draw.Rect) bool {
ret, _ := com.dm.CallMethod("LockMouseRect", r.Left(), r.Top(), r.Right(), r.Bottom())
return utils.IsOK(ret.Val)
}
func (com *DmSoft) SetAero(enable int) bool {
ret, _ := com.dm.CallMethod("SetAero", enable)
return utils.IsOK(ret.Val)
}
func (com *DmSoft) SetDisplayDelay(time int) bool {
ret, _ := com.dm.CallMethod("SetDisplayDelay", time)
return utils.IsOK(ret.Val)
}
func (com *DmSoft) SetDisplayRefreshDelay(time int) bool {
ret, _ := com.dm.CallMethod("SetDisplayRefreshDelay", time)
return utils.IsOK(ret.Val)
}
func (com *DmSoft) SwitchBindWindow(hwnd int) bool {
ret, _ := com.dm.CallMethod("SwitchBindWindow", hwnd)
return utils.IsOK(ret.Val)
}
func (com *DmSoft) UnBindWindow() bool {
ret, _ := com.dm.CallMethod("UnBindWindow")
return utils.IsOK(ret.Val)
}