how about emulating over-the-edge mouse hover, click-and-hold, move, release...
Quite few seem to know that pressing Win-key (or Ctrl+Esc, or activating the taskbar by other means) and then pressing Alt+Space opens the same menu as Alt+Space on other windows, with options Move, Resize, Close ("Close" closes the taskbar and opens a
shutdown dialog).
Doesn't naturally work when locked, and few tests have shown that Resize doesn't always work properly (for me).
But PostMessage seems to be similar: some times the taskbar can be made smaller only by pressing "up" (taskbar on
lower edge) and when cancelling (Esc) the taskbar minimizes (to unvisible) only (not before) then.
The (mentioned) PostMessage is in principal same as Alt + Space and resembles WinMove or ControlMove, but I couldn't make ControlMove to move taskbar either because it needs a control name or control's HWND, so it can't move the whole window, I guess ...
By the way, if you want to move taskbar (also locked) use 0xF010 instead of 0xF000. Use mouse after the first key press to test (
to not to have to press tens of times or wait for key repetation).
(Text in italic may be "not the best possible expression")