Solved

Show Text in the Status bar of an SDI app

Posted on 2004-04-25
4
371 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Detect CR LF to each line 12 137
sum28 challenge 31 96
building a service to accessed via telnet client, want colors ? 4 78
mapAB Challlenge 35 89
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now