Click here to Skip to main content
15,910,981 members
Articles / Desktop Programming / MFC
Article

XP style Explorer Bar (Win32/MFC)

Rate me:
Please Sign up or sign in to vote.
4.86/5 (54 votes)
4 Mar 20042 min read 480.1K   9.2K   146   154
Implementation of a shellstyle.dll aware XP Windows Explorer Bar

Image 1

Introduction

This article presents a full implementation of the Windows XP Explorer Bar as a set of Win32 controls and a MFC wrapper. The Explorer Bar works on Windows 98/Me/2k/XP and is fully shellstyle.dll aware, i.e. can be used with any XP visual theme (standard, 3rd party non-standard, and the classic Windows scheme).

The new custom controls include extended button controls, extended static controls, tasklink controls, and collapsible header controls.

Background

The Windows Explorer that comes with Windows XP introduces a fancy new control bar called "Explorer Bar". The bar handles one or more collapsible panes containing tasklinks or informative text and having a collapsible header control.

The Explorer Bar is neither exported by any API nor uses it the standard XP theme renderer. All bitmaps and metrics reside in specialized DLLs named "shellstyle.dll".

The implementation presented here has a full parser for this non-standard information and a highly sophisticated rendering engine allowing fade and roll effects to be applied to expanding/collapsing panes.

Using the code

The zip archive contains a Platform SDK like HTMLHelp file (explorerbar.chm) with the full documentation (Win32/MFC). You must build all configurations of explorerbar.dsw before using the library. If you are interested in the sample application, then build ExpBarSample.dsw as well.

After building all configurations of explorerbar.dsw you find the library in "explorerbar\lib" and the MFC wrapper in "explorerbar\lib\MFC".

General comments, points of interest

Approx. 18.000 lines of code needed to be written in order to support all functionalities of the Windows XP Explorer Bar, i.e. expect bug-fixes!

Even if the Explorer Bar will be exported in the future by an API, it will not work under Windows 98/Me/2k because it will probably use a new XP theme renderer tightly linked to Windows XP.

One big TODO item is a pure MFC version of the Explorer Bar. This would simplify the message handling stated in the Explorer Bar SDK (HTMLHelp). The current implementation (explorerbar.dll) has been written for Win32 applications for maximum platform support.

History

Version 1.0 is the first published version of the Explorer Bar. It is embedded in the great sizeable control bar by Cristi Posea.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior)
Germany Germany
Dipl.-Inform., 26 years experience (1985-2011) in coding/software development (C/C++/C#/Java/x86-Assembler), experienced in Win32/MFC/WPF development, UNIX (Linux/Solaris), and especially in IT-security

Comments and Discussions

 
AnswerRe: Control CBStatic32 Object Pin
gunag9-Mar-06 21:01
gunag9-Mar-06 21:01 
GeneralRe: Control CBStatic32 Object Pin
Joeny1-May-06 3:44
Joeny1-May-06 3:44 
GeneralMemory Leak Pin
Alexander Gräf3-Oct-05 14:24
Alexander Gräf3-Oct-05 14:24 
GeneralRe: Memory Leak Pin
melcug25-Jan-06 6:20
melcug25-Jan-06 6:20 
GeneralWould it be possible Pin
Stefan Dahlin27-Sep-05 23:02
Stefan Dahlin27-Sep-05 23:02 
GeneralSuch a nice control, but such a coding mess Pin
Alexander Gräf26-Sep-05 3:18
Alexander Gräf26-Sep-05 3:18 
GeneralRe: Such a nice control, but such a coding mess Pin
Ingo A. Kubbilun26-Sep-05 3:35
Ingo A. Kubbilun26-Sep-05 3:35 
GeneralRe: Such a nice control, but such a coding mess Pin
Alexander Gräf26-Sep-05 3:51
Alexander Gräf26-Sep-05 3:51 
I dont know how to do it better, but thats not the point. And no, I never created code which could be useful to the community, and no I never completed any of my started free projects because I never found the time for that. It is also unlikely that I'll ever post an article on CodeProject. But I dont have to be a film director in order to criticize a movie.

And as I stated, the control works correctly, supports themes and has, as far as I can see from missing bug reports, not many errors.

However, I often downloaded code snippets from CodeProject, and many of them gave me a good starting point, or were nearly complete. Your control *is* complete, but it is no starting point to whatever one would like to do with it, besides taking it as a complete form. What about sticking it on sourceforge, and finding some people (like me?) which can help making this control a lot easier to understand?

You're the one to calm down. You have my respect for the time you've spend on this control and the fact you are sharing your work with the community, but that doesnt change the fact that the C-code is pretty useless, except for big companies which want to save money on commercial controls. It was not my intention to insult you in any way.

Cheers
GeneralThe image is not displaying properly. Pin
santhu_sindhu18-Aug-05 20:14
santhu_sindhu18-Aug-05 20:14 
GeneralUpdate ExplorerBar Pin
Puhhbaerchen10-Jul-05 5:18
Puhhbaerchen10-Jul-05 5:18 
GeneralRe: Update ExplorerBar Pin
Ingo A. Kubbilun10-Jul-05 22:33
Ingo A. Kubbilun10-Jul-05 22:33 
Generalcompile questions Pin
vaccy30-May-05 21:16
vaccy30-May-05 21:16 
GeneralRe: compile questions Pin
Ingo A. Kubbilun30-May-05 21:52
Ingo A. Kubbilun30-May-05 21:52 
GeneralRe: compile questions Pin
vaccy31-May-05 20:33
vaccy31-May-05 20:33 
GeneralRe: compile questions Pin
Ingo A. Kubbilun31-May-05 23:45
Ingo A. Kubbilun31-May-05 23:45 
GeneralRe: compile questions Pin
BFSer2-Jun-05 6:26
BFSer2-Jun-05 6:26 
QuestionPosible to Manually Set Background Color? Pin
j.jonez25-May-05 13:39
j.jonez25-May-05 13:39 
AnswerRe: Posible to Manually Set Background Color? Pin
Ingo A. Kubbilun30-May-05 22:03
Ingo A. Kubbilun30-May-05 22:03 
GeneralWTL ExplorerBar Pin
Ralph Wetzel25-Mar-05 22:38
Ralph Wetzel25-Mar-05 22:38 
GeneralFix for bitmaps whose width is not DWORD aligned Pin
Kristinm18-Feb-05 1:53
Kristinm18-Feb-05 1:53 
GeneralRe: Fix for bitmaps whose width is not DWORD aligned Pin
Kristinm18-Feb-05 1:58
Kristinm18-Feb-05 1:58 
QuestionCan you give an example which the explorer bar is nested in view!? Pin
IdoIwill15-Jan-05 23:02
IdoIwill15-Jan-05 23:02 
AnswerRe: Can you give an example which the explorer bar is nested in view!? Pin
Ingo A. Kubbilun22-Jan-05 1:47
Ingo A. Kubbilun22-Jan-05 1:47 
GeneralI know where is the problem! Pin
IdoIwill23-Jan-05 2:06
IdoIwill23-Jan-05 2:06 
Questionwhy when the explorerbar in view the background is white!? Pin
IdoIwill13-Jan-05 22:21
IdoIwill13-Jan-05 22: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.