Click here to Skip to main content
13,862,709 members
Click here to Skip to main content
Add your own
alternative version


49 bookmarked
Posted 11 Jun 2002
Licenced CPOL

Taskbar Sorter Utility

, 11 Jun 2002
Rate this:
Please Sign up or sign in to vote.
Utility to change order of icons in taskbar
<!-- Download Links --> <!-- Add the rest of your HTML here -->


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

<!-- Article image -->

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!



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
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.

You may also be interested in...

Comments and Discussions

QuestionRe: New category? Pin
mla15424-Jan-13 5:39
membermla15424-Jan-13 5:39 
GeneralMy vote of 3 Pin
SercanOzdemir7-Dec-11 9:02
memberSercanOzdemir7-Dec-11 9:02 
GeneralMy vote of 5 Pin
Pepsibot9-Sep-10 6:40
memberPepsibot9-Sep-10 6:40 
GeneralDont work with "Group similar taskbar buttons" enabled. [modified] Pin
Alejandro Pardo30-Dec-08 10:05
memberAlejandro Pardo30-Dec-08 10:05 
AnswerRe: Dont work with "Group similar taskbar buttons" enabled. Pin
Paul Vickery6-Jan-09 1:56
professionalPaul Vickery6-Jan-09 1:56 
GeneralRe: Dont work with "Group similar taskbar buttons" enabled. Pin
Alejandro Pardo6-Jan-09 2:34
memberAlejandro Pardo6-Jan-09 2:34 
Question.Net Code Pin
plury19-Feb-07 6:16
memberplury19-Feb-07 6:16 
GeneralDrag and Drop buttons on Taskbar and save order Pin
The Code Machine27-Jan-06 22:14
memberThe Code Machine27-Jan-06 22:14 
GeneralRe: Drag and Drop buttons on Taskbar and save order Pin
Sa6ry3-Apr-06 8:06
memberSa6ry3-Apr-06 8:06 
GeneralSave the Order Pin
HerrDamit8-Aug-04 4:35
memberHerrDamit8-Aug-04 4:35 
GeneralRe: Save the Order Pin
kpatelPro29-Oct-04 9:19
memberkpatelPro29-Oct-04 9:19 
GeneralRe: Save the Order Pin
DTY15-Aug-05 9:45
memberDTY15-Aug-05 9:45 
GeneralRe: Save the Order Pin
DTY22-Jun-06 7:08
memberDTY22-Jun-06 7:08 
GeneralWindows XP Pin
wayside28-Jul-04 7:43
memberwayside28-Jul-04 7:43 
GeneralIcon Color Improvement Pin
Atlantys16-Jun-02 20:27
memberAtlantys16-Jun-02 20:27 
GeneralJames would be tickled by this Pin
Nish Nishant12-Jun-02 20:05
sitebuilderNish Nishant12-Jun-02 20:05 
GeneralRe: James would be tickled by this Pin
Paul Vickery12-Jun-02 23:31
professionalPaul Vickery12-Jun-02 23:31 
GeneralRe: James would be tickled by this Pin
Nish Nishant13-Jun-02 0:46
sitebuilderNish Nishant13-Jun-02 0:46 
GeneralPC Mag has similar utility Pin
12-Jun-02 15:31
suss12-Jun-02 15:31 
GeneralRe: PC Mag has similar utility Pin
Paul Vickery12-Jun-02 23:34
professionalPaul Vickery12-Jun-02 23:34 
GeneralRe: PC Mag has similar utility Pin
vikrant kpr13-Jul-07 4:56
membervikrant kpr13-Jul-07 4:56 
GeneralRe: PC Mag has similar utility Pin
Philippe Lhoste24-Jun-02 1:42
memberPhilippe Lhoste24-Jun-02 1:42 
GeneralRe: PC Mag has similar utility Pin
Synetech12-Aug-06 17:34
memberSynetech12-Aug-06 17:34 
GeneralCool Pin
Rama Krishna Vavilala12-Jun-02 4:24
memberRama Krishna Vavilala12-Jun-02 4:24 
GeneralRe: Cool Pin
Atlantys12-Jun-02 21:21
memberAtlantys12-Jun-02 21:21 

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

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