Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » CExtStatusControlBar in a Dialog Collapse All
Subject Author Date
Bill Parry Sep 29, 2005 - 4:06 PM

I have successfully added a CExtMenuControlBar and a CExtStatusControlBar to an important dialog in my application. The status bar works OK, except that I do not see the AFX_IDS_IDLEMESSAGE text in the status bar when no menu is active. How can I accomplish this?


Regards,

Bill Parry Sep 30, 2005 - 10:32 AM

Thank you! I’ll try it immediately.


Regards,

Technical Support Sep 30, 2005 - 6:28 AM

Just handle the WM_SETMESSAGESTRING message in your dialog and implement this behavior yourself as it is done in the ProfUIS_Controls sample (Status Bar page):

LRESULT CPageStatusBar::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) 

{

      LRESULT lResult = CPageBase::WindowProc(message, wParam, lParam);

      if( message == WM_SETMESSAGESTRING )

      {

            CString strMessage;

            if( !strMessage.LoadString( (UINT)wParam ) )

            {

                  if( !strMessage.LoadString( (UINT)AFX_IDS_IDLEMESSAGE ) )

                        strMessage = _T("");

            }

            if( !strMessage.IsEmpty() )

            {

                  LPTSTR pSlashN = (LPTSTR)_tcschr( strMessage, _T(’\n’) );

                  if( pSlashN != NULL )

                        *pSlashN = _T(’\0’);

            }

            int nIdlePaneIndex =

                  m_wndStatusBar.CommandToIndex( 0 );

            if( nIdlePaneIndex != -1)

                  m_wndStatusBar.SetPaneText( nIdlePaneIndex, strMessage );

            return 0L;

      }

      return lResult;

}