Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Icon in statusBar Collapse All
Subject Author Date
Shailesh Nikam Jan 25, 2007 - 2:22 AM


Can you tell me how to put icon in status bar pane?

Thanks in advance,

Shailesh Nikam Jan 28, 2007 - 9:50 PM


Call to CStatusBar::GetStatusBarCtrl is giving compilation error

"error C2352: ’CStatusBar::GetStatusBarCtrl’ : illegal call of non-static member function"

So how can I call this method?


Suhai Gyorgy Jan 29, 2007 - 2:07 AM

Maybe the problem is in your syntax. I tried it in my application, in which I have a statusbar of class CExtStatusControlBar with the name m_wndStatusBar. The following code worked just fine in MainFrame’s OnCreate method, just after creating statusbar and setting its indicators: m_wndStatusBar.GetStatusBarCtrl().SetIcon(2, ::LoadIcon(NULL, IDI_HAND));

Technical Support Jan 25, 2007 - 7:07 AM

You can assign an icon to a particular pane in the status bar using the following code:


Suhai Gyorgy Jan 25, 2007 - 4:52 AM

In StatusPanes sample there is a CExtStatusBarLabel class (in ChildFormView.h). This class is derived from CExtLabel, which is derived from CStatic, thus it has a method called SetIcon(HICON hIcon). You can use this class to display an icon in your statusbar. I think you don’t even have to override the OnDrawLabelText as it is done in the sample, because you won’t have any text in that pane.