Click here to Skip to main content
15,891,473 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 478.2K   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: 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 
AnswerRe: why when the explorerbar in view the background is white!? Pin
bao.yang5-Feb-05 22:28
bao.yang5-Feb-05 22:28 
GeneralAgain Refresh/Redraw Pin
Pixbyte30-Sep-04 13:14
Pixbyte30-Sep-04 13:14 
GeneralAdding Active X Controls Pin
vish_198120-Aug-04 2:01
sussvish_198120-Aug-04 2:01 
GeneralCreating ActiveX controls on Panes Pin
rollocool19-Aug-04 2:49
rollocool19-Aug-04 2:49 
GeneralCompile Errors Pin
indyfromoz16-Jun-04 19:19
indyfromoz16-Jun-04 19:19 
Hi,

After downloading and extracting ExpBar_src_1_0_1.zip to a folder, I tried first compiling "ExpBarSample", and got this error -

...\xpbar_src_1_0_1\xpexplorerbar\expbarsample\stdafx.h(30) : fatal error C1083: Cannot open include file: 'explorerbar.h': No such file or directory
Error executing cl.exe.

I then went and tried to compile "explorerbar" and this time I got a bundle of errors Frown | :( -

:\Resources\Programming\VC++ Samples\XP Style Explorer bar\ExpBar_src_1_0_1\XPExplorerBar\explorerbar\cbbutton.c(650) : error C2065: 'WM_THEMECHANGED' : undeclared identifier
C:\Resources\Programming\VC++ Samples\XP Style Explorer bar\ExpBar_src_1_0_1\XPExplorerBar\explorerbar\cbbutton.c(650) : error C2051: case expression not constant
C:\Resources\Programming\VC++ Samples\XP Style Explorer bar\ExpBar_src_1_0_1\XPExplorerBar\explorerbar\cbbutton.c(920) : error C2065: 'NMBCHOTITEM' : undeclared identifier
C:\Resources\Programming\VC++ Samples\XP Style Explorer bar\ExpBar_src_1_0_1\XPExplorerBar\explorerbar\cbbutton.c(920) : error C2146: syntax error : missing ';' before identifier 'nmbchi'
C:\Resources\Programming\VC++ Samples\XP Style Explorer bar\ExpBar_src_1_0_1\XPExplorerBar\explorerbar\cbbutton.c(920) : error C2065: 'nmbchi' : undeclared identifier
C:\Resources\Programming\VC++ Samples\XP Style Explorer bar\ExpBar_src_1_0_1\XPExplorerBar\explorerbar\cbbutton.c(922) : error C2224: left of '.hdr' must have struct/union type
C:\Resources\Programming\VC++ Samples\XP Style Explorer bar\ExpBar_src_1_0_1\XPExplorerBar\explorerbar\cbbutton.c(923) : error C2224: left of '.hdr' must have struct/union type
C:\Resources\Programming\VC++ Samples\XP Style Explorer bar\ExpBar_src_1_0_1\XPExplorerBar\explorerbar\cbbutton.c(924) : error C2224: left of '.hdr' must have struct/union type
C:\Resources\Programming\VC++ Samples\XP Style Explorer bar\ExpBar_src_1_0_1\XPExplorerBar\explorerbar\cbbutton.c(925) : error C2224: left of '.dwFlags' must have struct/union type
C:\Resources\Programming\VC++ Samples\XP Style Explorer bar\ExpBar_src_1_0_1\XPExplorerBar\explorerbar\cbbutton.c(926) : error C2224: left of '.hdr' must have struct/union type
C:\Resources\Programming\VC++ Samples\XP Style Explorer bar\ExpBar_src_1_0_1\XPExplorerBar\explorerbar\cbbutton.c(926) : error C2198: 'SendMessageA' : too few actual parameters
C:\Resources\Programming\VC++ Samples\XP Style Explorer bar\ExpBar_src_1_0_1\XPExplorerBar\explorerbar\cbbutton.c(951) : error C2146: syntax error : missing ';' before identifier 'nmbchi'
C:\Resources\Programming\VC++ Samples\XP Style Explorer bar\ExpBar_src_1_0_1\XPExplorerBar\explorerbar\cbbutton.c(953) : error C2224: left of '.hdr' must have struct/union type
C:\Resources\Programming\VC++ Samples\XP Style Explorer bar\ExpBar_src_1_0_1\XPExplorerBar\explorerbar\cbbutton.c(954) : error C2224: left of '.hdr' must have struct/union type
C:\Resources\Programming\VC++ Samples\XP Style Explorer bar\ExpBar_src_1_0_1\XPExplorerBar\explorerbar\cbbutton.c(955) : error C2224: left of '.hdr' must have struct/union type
C:\Resources\Programming\VC++ Samples\XP Style Explorer bar\ExpBar_src_1_0_1\XPExplorerBar\explorerbar\cbbutton.c(956) : error C2224: left of '.dwFlags' must have struct/union type
C:\Resources\Programming\VC++ Samples\XP Style Explorer bar\ExpBar_src_1_0_1\XPExplorerBar\explorerbar\cbbutton.c(957) : error C2224: left of '.hdr' must have struct/union type
C:\Resources\Programming\VC++ Samples\XP Style Explorer bar\ExpBar_src_1_0_1\XPExplorerBar\explorerbar\cbbutton.c(957) : error C2198: 'SendMessageA' : too few actual parameters
C:\Resources\Programming\VC++ Samples\XP Style Explorer bar\ExpBar_src_1_0_1\XPExplorerBar\explorerbar\cbbutton.c(1363) : error C2065: 'DFCS_HOT' : undeclared identifier
cbstatic.c

This is just a small part of the whole list of errors. I have downloaded and installed the latest platform SDK from Microsoft. And I have also added the lib and include folders in Visual Studio. I would appreciate any hints/help in this regard.

Thanks a lot for making this code publicly!

Cheers,
Indrajit
GeneralRe: Compile Errors Pin
Ingo A. Kubbilun17-Jun-04 2:26
Ingo A. Kubbilun17-Jun-04 2:26 
GeneralGet Item information from a pane Pin
Pixbyte5-Jun-04 12:29
Pixbyte5-Jun-04 12:29 
GeneralRe: Get Item information from a pane Pin
Ingo A. Kubbilun6-Jun-04 22:27
Ingo A. Kubbilun6-Jun-04 22:27 
GeneralRe: Get Item information from a pane Pin
Pixbyte7-Jun-04 2:27
Pixbyte7-Jun-04 2:27 
GeneralRe: Get Item information from a pane Pin
Pixbyte30-Sep-04 13:17
Pixbyte30-Sep-04 13:17 
GeneralError !!! VC++.NET 2003 !!! Pin
Razr3333-Mar-04 8:09
Razr3333-Mar-04 8:09 
GeneralRe: Error !!! VC++.NET 2003 !!! Pin
Ingo A. Kubbilun3-Mar-04 8:18
Ingo A. Kubbilun3-Mar-04 8:18 
GeneralRe: Error !!! VC++.NET 2003 !!! Pin
Razr3333-Mar-04 8:32
Razr3333-Mar-04 8:32 
GeneralRe: Error !!! VC++.NET 2003 !!! Pin
Ingo A. Kubbilun4-Mar-04 16:02
Ingo A. Kubbilun4-Mar-04 16:02 
GeneralRe: Error !!! VC++.NET 2003 !!! Pin
Mathew Hall9-Mar-04 21:20
Mathew Hall9-Mar-04 21:20 
GeneralRe: Error !!! VC++.NET 2003 !!! Pin
Anthony_Yio21-Mar-04 20:18
Anthony_Yio21-Mar-04 20:18 
GeneralErrors compiling with Visual Studio C++ 6.0 Pin
accarvajal3-Mar-04 4:01
accarvajal3-Mar-04 4:01 
GeneralRe: Errors compiling with Visual Studio C++ 6.0 Pin
Ingo A. Kubbilun3-Mar-04 7:53
Ingo A. Kubbilun3-Mar-04 7:53 
GeneralRe: Errors compiling with Visual Studio C++ 6.0 Pin
accarvajal3-Mar-04 11:26
accarvajal3-Mar-04 11:26 
GeneralRe: Errors compiling with Visual Studio C++ 6.0 Pin
cinda2-Oct-04 15:46
cinda2-Oct-04 15:46 
GeneralRe: Errors compiling with Visual Studio C++ 6.0 Pin
cinda2-Oct-04 15:46
cinda2-Oct-04 15:46 
Questionhow can I use your class in win32 program? Pin
hanghouse28-Feb-04 20:45
hanghouse28-Feb-04 20:45 

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.