Thread: status bar

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    12

    status bar

    Hi, I have a main window and I want to put a status bar into it. How can I do that? And how can i put text into this bar?
    Thanx.

  2. #2
    Registered User (TNT)'s Avatar
    Join Date
    Aug 2001
    Location
    UK
    Posts
    339
    Hey,


    Firstly, include <comctrl.h> and link comctl32.lib


    define the following under your headers:

    Code:
    #define ID_STATUSBAR       4997
    HWND hWndStatus;

    Then under where you create your main window, in winmain put this:

    Code:
    InitCommonControls();
    
    hWndStatus = CreateWindowEx(0, STATUSCLASSNAME, NULL,
    WS_CHILD | WS_VISIBLE | SBARS_SIZEGRIP, 0, 0, 0, 0,
    hWnd, (HMENU)ID_STATUSBAR, hInstance, NULL);

    Then to add text to your status bar, this can go where suites you or ur prog...

    Code:
    case WM_LBUTTONDOWN:
    {
    SetWindowText(hWndStatus, "La La La Status Bar Clicked");
    }

    Hope that helps,
    TNT
    TNT
    You Can Stop Me, But You Cant Stop Us All

  3. #3
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    Go to msdn and search for CreateStatusWindow(). There will be information on its use and maybe some source to look at.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  4. #4
    Registered User
    Join Date
    Jan 2002
    Posts
    12
    thanx for all i'll try that

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. status bar flickering
    By rakan in forum Windows Programming
    Replies: 5
    Last Post: 01-07-2008, 10:11 PM
  2. beach bar (sims type game)
    By DrKillPatient in forum Game Programming
    Replies: 1
    Last Post: 03-06-2006, 01:32 PM
  3. Status bar
    By maxorator in forum Windows Programming
    Replies: 3
    Last Post: 11-06-2005, 11:45 AM
  4. Troubles with Sockets
    By cornholio in forum Windows Programming
    Replies: 6
    Last Post: 10-26-2005, 05:31 AM
  5. Disabling "Ready" & Other Auto Status Bar Updates :: MFC
    By kuphryn in forum C++ Programming
    Replies: 1
    Last Post: 04-03-2002, 08:51 PM