Solved

Show Text in the Status bar of an SDI app

Posted on 2004-04-25
4
377 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

 Watch the Recording: Learning MySQL 5.7

MySQL 5.7 has a lot of new features. If you've dabbled with an older version of MySQL, it is definitely worth learning.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Suggested Courses

630 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