I have added this solution from the details provided by badrelmers, in a comment above.
I found a C code that worked after some editing, I posted the source and binary here if someone need it
how to resize the bottom taskbar ? · Issue #3 · m417z/taskbar-resize · GitHub[
^]. See also
https://stackoverflow.com/questions/77022306/how-to-resize-windows-taskbar-programmatically[
^].
#include <windows.h>
#include <shlwapi.h>
void main()
{
int argc;
WCHAR **argv = CommandLineToArgvW(GetCommandLine(), &argc);
if(argv)
{
if(argc >= 3)
{
BOOL bBottom = lstrcmpi(argv[1], L"-b") == 0;
BOOL bTop = lstrcmpi(argv[1], L"-t") == 0;
BOOL bRight = lstrcmpi(argv[1], L"-r") == 0;
BOOL bLeft = lstrcmpi(argv[1], L"-l") == 0;
int nMySize = StrToInt(argv[2]);
HWND hTaskbarWnd = FindWindow(L"Shell_TrayWnd", NULL);
if(hTaskbarWnd)
{
RECT rc;
GetWindowRect(hTaskbarWnd, &rc);
if(bBottom) {
rc.top = rc.bottom - nMySize;
SendMessage(hTaskbarWnd, WM_SIZING, WMSZ_TOP, (LPARAM)&rc);
SetWindowPos(hTaskbarWnd, NULL, 0, 0, rc.right - rc.left, nMySize, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
}
else if(bTop) {
rc.bottom = rc.top + nMySize;
SendMessage(hTaskbarWnd, WM_SIZING, WMSZ_BOTTOM, (LPARAM)&rc);
SetWindowPos(hTaskbarWnd, NULL, 0, 0, rc.right - rc.left, nMySize, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
}
else if(bRight) {
rc.left = rc.right - nMySize;
SendMessage(hTaskbarWnd, WM_SIZING, WMSZ_LEFT, (LPARAM)&rc);
SetWindowPos(hTaskbarWnd, NULL, 0, 0, nMySize, rc.bottom - rc.top, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
}
else if(bLeft) {
rc.right = rc.left + nMySize;
SendMessage(hTaskbarWnd, WM_SIZING, WMSZ_LEFT, (LPARAM)&rc);
SetWindowPos(hTaskbarWnd, NULL, 0, 0, nMySize, rc.bottom - rc.top, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
}
}
}
LocalFree(argv);
}
ExitProcess(0);
}
NB: for top and bottom positions, you cannot resize to 3 rows from 1 row you have to resize to 2 rows first then resize to 3 rows
the following numbers are based on the taskbar with small icons not the big ones
taskbar_resize.exe -b 60 ===> 1 row
taskbar_resize.exe -b 70 ===> 2 rows
taskbar_resize.exe -b 110 ===> 3 rows
taskbar_resize.exe -b 150 ===> 4 rows
taskbar_resize.exe -b 180 ===> 5 rows
taskbar_resize.exe -b 220 ===> 6 rows
taskbar_resize.exe -b 250 ===> 7 rows