This autohotkey code works fine to resize the win 7 taskbar when it is on the left position
ResizeTaskbar(170)
ResizeTaskbar(size) {
pAppBarData := Buffer(48), NumPut("uint", pAppBarData.Size, pAppBarData)
DllCall("Shell32\SHAppBarMessage", "uint", 0x00000005, "ptr", pAppBarData)
hTB := WinExist("ahk_class Shell_TrayWnd")
NumPut("int", -A_ScreenWidth, pAppBarData, 24), NumPut("int", size, pAppBarData, 32)
SendMessage(0x0214, 2, pAppBarData.Ptr + 24, , hTB), WinMove(0, 0)
}
I want to resize the taskbar when it is in bottom position so I changed the above code to:
ResizeTaskbar(170)
ResizeTaskbar(size) {
pAppBarData := Buffer(48), NumPut("uint", pAppBarData.Size, pAppBarData)
DllCall("Shell32\SHAppBarMessage", "uint", 0x00000005, "ptr", pAppBarData)
hTB := WinExist("ahk_class Shell_TrayWnd")
NumPut("int", -A_ScreenHeight, pAppBarData, 24), NumPut("int", size, pAppBarData, 32)
;https://learn.microsoft.com/en-us/windows/win32/winmsg/wm-sizing
SendMessage(0x0214, 3, pAppBarData.Ptr + 24, , hTB), WinMove(0, 0)
}
but it does not work, where is the problem?
thank you
I could not make the autohotkey code to work, but i found a C code that worked after some editing, I posted the source and binary here if someone need it https://github.com/m417z/taskbar-resize/issues/3
Usage
taskbar_resize.exe (-l|-r|-b|-t) new_sizeDescription:
-l- The taskbar is on the left.-r- The taskbar is on the right.-b- The taskbar is on the bottom.-t- The taskbar is on the top.new_size- The new size of the taskbar, in pixels.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
update: I uploaded a compiled version for xp+ if someone need it, here: https://github.com/badrelmers/taskbar-resize/releases/tag/v1