There are several free tools (for example, Taskbar Shuffle, XNeat, etc.) that have the ability to reorder buttons on the taskbar without actually closing or opening windows. Unfortunately, none of them are open source.
What are the API calls needed to rearrange the buttons on the taskbar?
windows winapi button taskbar
Timwi
source share