Download source files - 2 Kb
Download demo project - 37 Kb
Introduction
You must have seen a lot of very fancy Status Bars in different samples and commercial
applications with progress bars, animation, images etc etc. Here, I present a technique
for making a Text Only Status bar with many text-only panes and with it's own tool tips
extracted from the Status Bar panes themselves.
You can easily replace the standard status bar in an existing SDI/MDI app by including:
#include "TextualStatusBar.h"
at the top. For a dialog based app you can create it in OnCreate()
.
Although this might not be the best Status Bar around, I've shown you the way to
deal with a Status bar and tool tip control as a child window. Furthermore, there are a
couple of other (read, better!) ways for adding tool tips to any control. The technique I
used in the sample is the same one that I used in an app because it was a requirement. I
caught WM_NCHITTEST
over the status bar and updated the tool tip text.
This example also teaches how to get to the individual panes of the status bar and
perform an operation on them. This example also illustrates the tight connection between MFC
CStatusBar
and CStatusBarCtrl
classes.
Please don not hesitate to mail me any bug, suggestion, clarification, query etc.