There are a few freeware tools out there (e.g., Taskbar Shuffle, XNeat, etc.) which have the ability to change the order of the buttons on the taskbar, without actually closing or opening any windows. Unfortunately, none of them appears to be open-source.
What are the API calls required to change the order of buttons in the taskbar?
The answer is to use TB_MOVEBUTTON
in a call to SendMessage()
, as described in the WinAPI documentation here.
The first parameter to SendMessage()
(hWndControl
) needs to be a reference to the toolbar that contains the taskbar buttons. This is non-trivial to retrieve, but the CodeProject entry referred to in Chris Clarke's answer has all the code required to retrieve this handle.
wParam
and lParam
need to be set to the button ID of the button to move, and the position to move it to, respectively. These IDs are the idCommand
field in the TBBUTTON
structure that represents each button; how to retrieve these structures for the buttons can also be taken from the above CodeProject entry.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With