Write to status bar using sprintf syntax
Posted
by Keith Rule
on August 6th, 1998
#include < stdarg.h > // StatusBarMessage() - Writes to status bar using sprintf syntax. // // Author: Keith Rule -- keithr@europa.com // // Copyright (c) 1995-1996, Keith Rule // May be freely used provided this comment // is included with the source and all derived // versions of this source. void StatusBarMessage(char* fmt, ...) { if (AfxGetApp() != NULL && AfxGetApp()->m_pMainWnd != NULL) { char buffer[256]; CStatusBar* pStatus = (CStatusBar*) AfxGetApp()->m_pMainWnd->GetDescendantWindow(AFX_IDW_STATUS_BAR); va_list argptr; va_start(argptr, fmt); vsprintf(buffer, fmt, argptr); va_end(argptr); if (pStatus != NULL) { pStatus->SetPaneText(0, buffer); pStatus->UpdateWindow(); } } }

Comments
HomePage
Posted by Legacy on 03/02/2002 12:00amOriginally posted by: amit
See My Statusbar
ReplyIm New How Do I Use that code?
Posted by Legacy on 08/31/2001 12:00amOriginally posted by: RYan Zimmerman
How Would I call that code up? Im very new. I have programmed in C++ long long time ago though.
ReplyUpdate Version II
Posted by Legacy on 06/26/2001 12:00amOriginally posted by: V�ctor Carre�o
Replyupdated version
Posted by Legacy on 04/15/2000 12:00amOriginally posted by: Jeff Miller
Reply