Moving the Taskbar in Windows 11

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
Thalon
Posts: 15
Joined: 24 Nov 2016, 04:55

Moving the Taskbar in Windows 11

Post by Thalon » 21 May 2024, 07:04

I've been using the windows taskbar on the top for quite a while now, but was forced to upgrade to Windows 11 at work and there is no option to do so anymore (including registry hacks as far as I could find out).

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)
    }
}
Is there an alternate way to move the taskbar by some API functions or messages? If I get this to work I'll add the full window manager to the scripts section.
User avatar
Seven0528
Posts: 405
Joined: 23 Jan 2023, 04:52
Location: South Korea
Contact:

Re: Moving the Taskbar in Windows 11

Post by Seven0528 » 22 May 2024, 18:26

 You probably won't be able to do this without editing the registry. Even then, it's only possible up to version 21H2.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3
Starting with Windows 11, the taskbar is programmed using XAML instead of Win32, and for some reason, the option to change the taskbar position has been removed (likely due to design considerations, among other reasons).
  • English is not my native language. Please forgive any awkward expressions.
  • 영어는 제 모국어가 아닙니다. 어색한 표현이 있어도 양해해 주세요.
Thalon
Posts: 15
Joined: 24 Nov 2016, 04:55

Re: Moving the Taskbar in Windows 11

Post by Thalon » 28 May 2024, 06:06

Seven0528 wrote:
22 May 2024, 18:26
 You probably won't be able to do this without editing the registry. Even then, it's only possible up to version 21H2.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3
Starting with Windows 11, the taskbar is programmed using XAML instead of Win32, and for some reason, the option to change the taskbar position has been removed (likely due to design considerations, among other reasons).
Thanks a lot. I figured that there isn't a good solution anymore for now. Couldn't find anything in any programming language or help section. My last hope was that someone found some COM-Hack that works or something like that.
Post Reply

Return to “Ask for Help (v2)”