Click here to Skip to main content
Click here to Skip to main content

Taskbar Sorter Utility

By , 11 Jun 2002
 

Introduction

This utility allows you to change the order of items on your taskbar, by dragging them into position in a list.

Taskbar Sorter

The list shows all of your visible top-level windows. To move a window you simply drag the window's title into the order you wish the windows to appear, and click the Sort button.

To exit the utility, click on the Close button.

How it works

The application enumerates windows which are top-level (ie have no owner), and do not explicitly prevent themselves appearing in the taskbar. It adds each of the windows' titles to a drag list box (CDragListBox), along with the icon for the app. The user can then re-order the windows. When the user clicks the Sort button, each window is hidden using ShowWindow(SW_HIDE) and then re-shown (ShowWindow(SW_SHOW)) in the order of the list - top to bottom. This has the effect of the window being removed from the taskbar and then being re-added at the right-hand side.

Known limitations

Unfortunately there doesn't appear to be any way of interrogating the taskbar to determine, firstly which windows appear there, and secondly in what order they currently appear. This means that each time the utility is run the user needs to re-order each window from scratch.

That's all there is to it - have fun!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Paul Vickery
Software Developer (Senior)
United Kingdom United Kingdom
Member
Originally from an electronics background, I moved into software in 1996, partly as a result of being made redundant, and partly because I was very much enjoying the small amount of coding (in-at-the-deep-end-C) that I had been doing!
 
I swiftly moved from C to C++, and learned MFC, and then went on to real-time C on Unix. After this I moved to the company for which I currently work, which specialises in Configuration Management software, and currently program mainly in C/C++, for Windows. I have been gradually moving their legacy C code over to use C++ (with STL, MFC, ATL, and WTL). I have pulled in other technologies (Java, C#, VB, COM, SOAP) where appropriate, especially when integrating with third-party products.
 
In addition to that, I have overseen the technical side of the company website (ASP, VBScript, JavaScript, HTML, CSS), and have also worked closely with colleagues working on other products (Web-based, C#, ASP.NET, SQL, etc).
 
For developing, I mainly use Visual Studio 2010, along with an in-house-designed editor based on Andrei Stcherbatchenko's syntax parsing classes, and various (mostly freeware) tools. For website design, I use Dreaweaver CS3.
 
When not developing software, I enjoy listening to and playing music, playing electric and acoustic guitars and mandolin.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionRe: New category?membermla15424 Jan '13 - 4:39 
Why is this article in the web development category?   I would think a better place for it would be here:
 
Articles » Desktop Development » Desktop Gadgets » General

 
Overall, I like your application.   Thumbs Up | :thumbsup:
 
As you had noted, though, the order of the list of applications initially shown is something that can be improved (if that's possible).
 
Regards,
Mike
GeneralMy vote of 3memberSercanOzdemir7 Dec '11 - 8:02 
There aren't enough explain on that article.And it's not an article i think.
GeneralMy vote of 5memberPepsibot9 Sep '10 - 5:40 
Simple but essential.
GeneralDont work with "Group similar taskbar buttons" enabled. [modified]memberAlejandro Pardo30 Dec '08 - 9:05 
That, when u has enabled the option "Group similar taskbar buttons" in the taskbar properties the app doesnt work.
The windows simply re-appear in the original order.
 
Just a constructive comment. Big Grin | :-D
 
Usefull program dude !
 
modified on Tuesday, December 30, 2008 6:21 PM

AnswerRe: Dont work with "Group similar taskbar buttons" enabled.memberPaul S. Vickery6 Jan '09 - 0:56 
Hi,
 
Yes, this is a limitation, though this post[^] has some code which says it will make my app work with XP's grouping. I've not tried the posted code though.
 
Paul.
 

"The way of a fool seems right to him, but a wise man listens to advice" - Proverbs 12:15 (NIV)

GeneralRe: Dont work with "Group similar taskbar buttons" enabled.memberAlejandro Pardo6 Jan '09 - 1:34 
Thanks Paul. I changed the code as says the post and still doesnt work.
I dont know Visual C++ but I'll try to debug it.
Question.Net Codememberplury19 Feb '07 - 5:16 
Hi,
 
How would one convert this to .Net code as I a not a C++ programmer. I think I actually might have a commercial use for this so please let me know if you are interested in working together.
 
Contact me on Plury@24.com as I can not update my profile on the code project, it gives an error.
 
Thanks

GeneralDrag and Drop buttons on Taskbar and save ordermemberThe Code Machine27 Jan '06 - 21:14 
There is a utility "Taskbar Manager" at http://www.askarya.com/tm/tm.asp[^]which lets you drag and drop buttons on the taskbar. You can also save and load the order of taskbar buttons.
 
It works on Windows 2000 and XP. Works better on XP if taskbar button grouping is disabled.
 
TCM
 
Code till death
GeneralRe: Drag and Drop buttons on Taskbar and save ordermemberSa6ry3 Apr '06 - 7:06 
XNeat taskbar manager at http://www.xneat.com/ do the same..
GeneralSave the OrdermemberHerrDamit8 Aug '04 - 3:35 
Best thanks for this very needfull Tool from Germany Smile | :)
 
I would suggest, to save the Order that the user choses to a file. Mostly the first 5 to 10 Applications will be same Subject (also with choosen File etc.). So You could sort this ones and leave the rest as it is.
 
Would be much better Smile | :)
 
Greetings, Jan

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130523.1 | Last Updated 12 Jun 2002
Article Copyright 2002 by Paul Vickery
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid