Last active
March 5, 2024 15:47
-
-
Save Geobert/0ba4fe8d75c4fc668b027e44ee21e10a to your computer and use it in GitHub Desktop.
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
#singleinstance | |
; Move the taskbar to left screen, right side. | |
; Can’t use it because for some reason, when interacting with the taskbar with the mouse, it goes back to main screen | |
MoveTaskbar() | |
{ | |
If MonitorGetCount() > 1 | |
{ | |
WinExist("ahk_class Shell_TrayWnd") | |
SendMessage(0x0231) | |
WinMove -54, 0, 54, 1080 | |
SendMessage(0x0232) | |
} | |
} | |
; Move the taskbar using mouse, and resize it a bit | |
MoveTaskbar2() | |
{ | |
If MonitorGetCount() > 1 | |
{ | |
CoordMode "Mouse", "Screen" | |
WinExist("ahk_class Shell_TrayWnd") | |
WinGetPos &X, &Y | |
MouseClickDrag "Left", X + 20, 1100, -54, 600 | |
MouseClickDrag "Left", -54, 600, -58, 600 | |
} | |
} | |
MoveTaskbarCb(wParam, lParam, msg, hwnd) | |
{ | |
If MonitorGetCount() > 1 | |
{ | |
Sleep 2000 | |
MoveTaskbar2() | |
} | |
} | |
OnMessage 0x007E, MoveTaskbarCb | |
Persistent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.autohotkey.com/docs/v2/misc/SendMessageList.htm