Solved

Show Text in the Status bar of an SDI app

Posted on 2004-04-25
4
375 Views
Last Modified: 2013-11-20
Hi,

I have an SDI application to show an Image. While showing the Image I want to display some Image details on the Status bar of my SDI frame. And I don`t want to display anything else on the Status bar.

How can I do this? I am new in MFC. Please help me.

Thanks in advance,
Jayan
0
Comment
Question by:jayanms
  • 3
4 Comments
 
LVL 5

Accepted Solution

by:
Nass89 earned 50 total points
ID: 10915445
Hi,
1.
In MainFrm.cpp under indicators[] comment the Indicator you don't want like this:
static UINT indicators[] =
{
      ID_SEPARATOR,           // status line indicator
      ID_STAT_IND,
//      ID_INDICATOR_CAPS,
//      ID_INDICATOR_NUM,
//      ID_INDICATOR_SCRL,
};

2.
define ID_STAT_IND in resource.rc using resource editor, like this:
#define ID_STAT_IND                     57610

3.
Add a global function to your project like this:
void
m_SetPaneText(int Where, char *What)
{
  CWnd* pStatusBarWnd;
   CWnd* pFrameWnd;
   CMainFrame* pFrame;
   CStatusBar* pStatusBar;

   pFrameWnd = AfxGetMainWnd();
   pFrame = STATIC_DOWNCAST( CMainFrame, pFrameWnd );

   pStatusBarWnd = pFrame->GetMessageBar();
   pStatusBar = STATIC_DOWNCAST( CStatusBar, pStatusBarWnd );
   pStatusBar->SetPaneText( Where, What );

}

4.
Call function where you want:
m_SetPaneText(1, "My text on Status Bar");

Good Luck!
0
 

Author Comment

by:jayanms
ID: 10915489
Thank you Nas. It is working okay!
0
 
LVL 5

Expert Comment

by:Nass89
ID: 10915508
Hi,
Thanks for the points. If it works fine, why a "B grade" for it?
0
 
LVL 5

Expert Comment

by:Nass89
ID: 10915548
xx
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question