Text in status bar

This is a discussion on Text in status bar within the Windows Programming forums, part of the Platform Specific Boards category; I found this piece of code on the internet Code: CString s = "Text"; CStatusBar* p = (CStatusBar*)AfxGetApp()->m_pMainWnd->GetDescendantWindow(AFX_IDW_STATUS_BAR); p->SetPaneText(1, s); ...

  1. #1
    Unregistered
    Guest

    Text in status bar

    I found this piece of code on the internet
    Code:
    CString s = "Text";
    CStatusBar* p =
    (CStatusBar*)AfxGetApp()->m_pMainWnd->GetDescendantWindow(AFX_IDW_STATUS_BAR);
    p->SetPaneText(1, s);
    It is supposed to write some text in the statusbar but I can't get it to work. Is there anyone that have any good ideas about how do do this.
    Thanks

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    591
    Never mind I figured out what I needed to do
    Code:
    void Prog::Test() 
    {
    CString s = "Text";
    CStatusBarCtrl* p = (CStatusBarCtrl*)AfxGetApp()->m_pMainWnd->GetDescendantWindow(AFX_IDW_STATUS_BAR);
    
    p->SetText(s,255,SBT_NOBORDERS   );
    	
    }
    That works better

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DirectX | Drawing text
    By gavra in forum Game Programming
    Replies: 4
    Last Post: 06-08-2009, 01:23 AM
  2. Windows API... Status Bar problems.
    By switchcase in forum Windows Programming
    Replies: 6
    Last Post: 10-11-2007, 05:59 PM
  3. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 10:54 AM
  4. Ok, Structs, I need help I am not familiar with them
    By incognito in forum C++ Programming
    Replies: 7
    Last Post: 06-29-2002, 10:45 PM
  5. program won't create status bar
    By Unregistered in forum Windows Programming
    Replies: 7
    Last Post: 08-30-2001, 05:00 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21