Some time ago, I found the excellent control "XP style Explorer Bar" that has been presented here on CodeProject as well as on the site of Ingo A. Kubbilun, who created this control. What makes it so special and different to the other (c++) implementations available in the net is the fact that,
and best of all, it provides full theme awareness!
This makes it a perfect starter to be implemented into any project.
The fact, that ExplorerBar does not depend on MFC or any other additional library makes it a true light component, that fits perfectly into any WTL project.
Users should keep in mind, that this is a wrapper around the existing control created by Ingo A. Kubbilun. A profound knowledge of the original documentation is usually the precondition for the successful use of any wrapper class.
This wrapper class has to be used like any other of it's kind within the WTL framework:
#include <span class="code-string">"wtl_explorerbar.h"</span>
You need to assure, that the files "explorerbar.h" and "shellstyle.h" from the original source are within the same folder as "wtl_explorerbar.h". Additionally, the correct DLL (coming from the explorerbar source, too) has to be present either in the same directory (which is preferred), or can be found within the standard system DLL search path.
LRESULT OnCreate(LPCREATESTRUCT lpCreateStruct)
// Assert, that libraries are present
bool bRes = exbar_.InitLibrary();
// Create the control...
exbar_.Create(*this, rcDefault, WS_CHILD
// This is standard
// ExplorerBar message handling starts here
// handlers of 1. pane
// handlers of 2.pane
// End of ExplorerBar message handling
// standard again
All standard kinds of message handler macros are available for the WTL ExplorerBar:
#define RELAY_MESSAGE_HANDLER(msg, func)
#define RELAY_MESSAGE_RANGE_HANDLER(msgFirst, msgLast, func)
#define RELAY_NOTIFY_HANDLER(id, cd, func)
#define RELAY_NOTIFY_CODE_HANDLER(cd, func)
#define RELAY_NOTIFY_ID_HANDLER(id, func)
#define RELAY_NOTIFY_RANGE_HANDLER(idFirst, idLast, func)
#define RELAY_COMMAND_HANDLER(id, cd, func)
#define RELAY_COMMAND_CODE_HANDLER(cd, func)
#define RELAY_COMMAND_ID_HANDLER(id, func)
#define RELAY_COMMAND_RANGE_HANDLER(idFirst, idLast, func)
These message handler functions have to be defined as follows:
LRESULT MessageHandler(UINT nMsg, WPARAM wParam,
LPARAM lParam, HWND hWndDlg, UINT uPaneId, BOOL& bHandled);
LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, HWND hwndDlg,
UINT uPaneId, BOOL& bHandled);
LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl,
HWND hWndDlg, UINT uPaneId, BOOL& bHandled);
The demo project uses the way to wrap DLL functions, that has once been presented on CodeProject by Yao Zhifeng. Thanks for sharing such ideas.
20050324 v1.0 Initial public release
WTL ExplorerBar is © 2005 Ralph-D. Wetzel, 88400 Biberach, Germany. All rights reserved.
The provided code is free for personal and commercial use, providing the copyright notice remains intact and all eventual changes are clearly marked with comments.
This code is provided "as is" and any expressed or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the author or any contributor be liable for any direct, indirect, incidental, special, exemplary, or consequential damage (including, but not limited to, procurement of substitute goods or services, loss of use, data or profits, or business interruption).
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
General News Suggestion Question Bug Answer Joke Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.