1 | $x_50percent = 1920 / 2 ; 960px |
---|
2 | $y_50percent = 1080 / 2 ; 540px |
---|
3 | |
---|
4 | MouseMove($x_50percent, $y_50percent) |
---|
5 | |
---|
6 | ; These APIs are Win10+ only |
---|
7 | |
---|
8 | ; Default Awareness of AutoIt |
---|
9 | $ret_GetDpiForSystemDefault = DllCall("User32.dll", "UINT", "GetDpiForSystem") |
---|
10 | $mousePosDpiDefault = MouseGetPos() |
---|
11 | |
---|
12 | ; Change awareness to PROCESS_SYSTEM_DPI_AWARE |
---|
13 | $ret_SetProcDpiAwareness = DllCall("Shcore.dll", "UINT", "SetProcessDpiAwareness", "INT", 1) |
---|
14 | $ret_GetDpiForSystemSystemAware = DllCall("User32.dll", "UINT", "GetDpiForSystem") |
---|
15 | $mousePosDpiSystemAware = MouseGetPos() |
---|
16 | |
---|
17 | MsgBox(0, "DPI Awareness results", _ |
---|
18 | "Default Awareness:" & @CRLF & _ |
---|
19 | "GetDpiForSystem: " & $ret_GetDpiForSystemDefault[0] & @CRLF & _ |
---|
20 | "MousePos: " & $mousePosDpiDefault[0] & "," & $mousePosDpiDefault[1] & @CRLF & @CRLF & _ |
---|
21 | _ |
---|
22 | "System-wide DPI Awareness:" & @CRLF & _ |
---|
23 | "GetDpiForSystem: " & $ret_GetDpiForSystemSystemAware[0] & @CRLF & _ |
---|
24 | "MousePos: " & $mousePosDpiSystemAware[0] & "," & $mousePosDpiSystemAware[1] _ |
---|
25 | ) |
---|
26 | |
---|
27 | $ret_SetProcDpiAwarenessCtx = DllCall("user32.dll", "BOOLEAN", "SetProcessDpiAwarenessContext", "INT", -1) |
---|