15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Examples of icons on a statusbar

Dave Silber -- Dave.Silber@hrb.com
Monday, March 10, 1997

Environment: NT 4.0, VC++ 4.2-flat

Instead of putting simple text on a status bar, I'd like to
put icons (or simple blocks of color) that I could dynamically
change as the state of the system changed. I'd also like to
trap mouse clicks on those icons.

Are there any examples for this in the MSVC++ documentation
(or elsewhere)? I've spent a few hours looking but haven't
found anything.

Any help would be appreciated....

Thanks,
Dave Silber

HRB-Systems            dns@hrb.com
E-Systems/Raytheon



Jason Healy -- jason@hkjcs.oz.au
Monday, March 17, 1997

[Mini-digest: 2 responses]

To add icons to the status bar, can be achieved by deriving your own
class say CIconStatusBar from CStatusBar, and overriding the function 
	
	void DrawItem(LPDRAWITEMSTRUCT)

You can create panes with the ID_SEPARATOR id, and once created
use the SetPaneStyle function to change the style to

	SBPS_OWNERDRAW

It's upto you how sophisticated you get, I used an pointer to a CImageList
object passed 
by my frame, and added a new function CIconStatusBar::SetIcon(int nPane,
int nIcon) which
provided me with an index into the image list. I also had this function
automatically change the
style for me, as well as the size of the icon.

You can mail me direct if you would like the source files, but these will
only be available for
a short amount of time.

Jason
jason@hkjcs.oz.au
-----From: "GoroKhM1" 

KB Q149407 How to Display a Bitmap in a CStatusBar Pane

MarkG@usa.net





Become an MFC-L member | Вернуться в корень Архива |