Created
June 6, 2019 01:01
-
-
Save ZachNo/191daf386dca7c1d3e2a760e8889b2f9 to your computer and use it in GitHub Desktop.
AutoHotkey script to switch monitors through hotkey for XP-PEN Artist 22HD which uses tabcfg.exe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
monitor = 1 | |
hLibModule := DllCall("LoadLibrary", "Str", "WinTab32.dll", "Ptr") | |
if(hLibModule == 0) { | |
MsgBox Failed to load Wintab32.dll! | |
} | |
SetMapMonitorStateProc := DllCall("GetProcAddress", "Ptr", hLibModule, "AStr", "TDSetMapMonitorState", "Ptr") | |
if(SetMapMonitorStateProc == 0) { | |
MsgBox Failed to get address of TDSetMapMonitorState! | |
} | |
OpenTabletDeviceProc := DllCall("GetProcAddress", "Ptr", hLibModule, "AStr", "OpenTabletDevice", "Ptr") | |
if(OpenTabletDeviceProc == 0) { | |
MsgBox Failed to get address of OpenTabletDevice! | |
} | |
openTabletDeviceReturn := DllCall(OpenTabletDeviceProc, "Int", 0, "Int") | |
^+F1:: | |
DllCall(SetMapMonitorStateProc, "Int", openTabletDeviceReturn, "Int", monitor) | |
if(monitor == 1) { | |
monitor = 2 | |
} else { | |
monitor = 1 | |
} | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment