Solved

Show Text in the Status bar of an SDI app

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

911 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

22 Experts available now in Live!

Get 1:1 Help Now