I have written my own window manager to move around windows on my multi monitor setup and wanted to use it to force the taskbar on the top, by just moving it there, but I can't get it to work for the taskbar.
I've condensed my code to show what I'm trying to do as the whole script has over 300 lines that are mostly unrelated to the problem. I can move the taskbar on secondary monitors (but they wont show a preview of the associated windows when hovered), but the primar taskbar wont even move up with this code:
Code: Select all
#Requires AutoHotkey v2.0
GroupAdd "TaskBar", "ahk_class Shell_TrayWnd"
GroupAdd "TaskBar", "ahk_class Shell_SecondaryTrayWnd"
TaskbarX := 0, TaskbarY := 0,TaskbarW := 0,TaskbarH := 0
TaskBars := WinGetList("ahk_group TaskBar")
for TaskBar in TaskBars
{
WinGetPos(&TaskbarX,&TaskbarY,&TaskbarW,&TaskbarH,Taskbar)
if TaskbarX = 0
{
TaskbarY := 0
WinMove(TaskbarX,TaskbarY,TaskbarW,TaskbarH,TaskBar)
}
}