@@ -30,11 +30,12 @@ myMenu.Add("Reset all hidden windows", Reset)
30
30
31
31
32
32
Reset (* ){
33
+ results := getSide()
34
+ leftMonitor := results[1 ]
35
+ leftEdge := results[3 ]
36
+ MonitorGet leftMonitor,,& topEdge
37
+ dpiValue := getDPI(leftMonitor)
33
38
; 多显示器支持
34
- MonitorGet 1 , & leftEdge,& topEdge
35
- monitorHandles := DPI.GetMonitorHandles()
36
- dpiValue := DPI.GetForMonitor(monitorHandles.Get(1 ))
37
- dpiValue := dpiValue / 120 * 125 / 100
38
39
global leftEdge
39
40
global dpiValue
40
41
global topEdge
@@ -102,10 +103,12 @@ WatchCursor(){
102
103
103
104
104
105
^Left ::{
105
- MonitorGet 1 , & leftEdge,& topEdge
106
- monitorHandles := DPI.GetMonitorHandles()
107
- dpiValue := DPI.GetForMonitor(monitorHandles.Get(1 ))
108
- dpiValue := dpiValue / 120 * 125 / 100
106
+ results := getSide()
107
+ leftMonitor := results[1 ]
108
+ leftEdge := results[3 ]
109
+ MonitorGet leftMonitor,,& topEdge
110
+ dpiValue := getDPI(leftMonitor)
111
+ ; 多显示器支持
109
112
global leftEdge
110
113
global dpiValue
111
114
global topEdge
@@ -125,6 +128,10 @@ F4::{
125
128
MsgBox " Window Position: " X " , " Y " `nWindow Size: " W " x " H
126
129
}
127
130
131
+ F8 ::{
132
+ getSide()
133
+ }
134
+
128
135
129
136
hideWindow (id ){
130
137
@@ -192,3 +199,34 @@ winSmoothMove(newX,newY,window){
192
199
}
193
200
}
194
201
202
+ ; 多显示器支持
203
+ ; 获取左右边界和显示器索引
204
+ getSide (){
205
+ leftEdge := 1
206
+ rightEdge := - 1
207
+ leftMonitor :=0
208
+ rightMonitor :=0
209
+ i:=1
210
+ while i<=MonitorGetCount(){
211
+ MonitorGet i, & leftEdgeTemp,,& rightEdgeTemp
212
+ if leftEdge > leftEdgeTemp{
213
+ leftEdge := leftEdgeTemp
214
+ leftMonitor := i
215
+ }
216
+ if rightEdge<rightEdgeTemp{
217
+ rightEdge:=rightEdgeTemp
218
+ rightMonitor:=i
219
+ }
220
+ i+ =1
221
+ ; MsgBox(i "," leftEdgeTemp "," rightEdgeTemp)
222
+ }
223
+ return [leftMonitor,rightMonitor,leftEdge,rightEdge]
224
+ }
225
+
226
+ getDPI (monitorIndex ){
227
+ monitorHandles := DPI.GetMonitorHandles()
228
+ dpiValue := DPI.GetForMonitor(monitorHandles.Get(monitorIndex))
229
+ dpiValue := dpiValue / 120 * 125 / 100
230
+ return dpiValue
231
+ }
232
+
0 commit comments