Status Bar Help

Started by
4 comments, last by madfisher 21 years, 8 months ago
Hi there, Does anybody know how to add a status bar to a sin32 application with no MFC in visual c++? THanks
Advertisement

    #define STATUSBAR 0x100HWND StatusBarHandle = CreateStatusWindow ( WS_CHILD | WS_VISIBLE, "", MainWindowHandle, STATUSBAR );  


the STATUSBAR is the id that will be used e.g. in your messageloop to identify messages from the statusbar



Runicsoft -- home of my open source Function Parser and more

[edited by - Burning_Ice on September 12, 2002 3:51:22 PM]
Google on "CreateStatusWindow". This function basically wraps CreateWindowEx. Set the handle to the main window as the parent of the status bar window. Also look up SB_SETPARTS for info on setting the number of panels on the status bar.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
Thanks that worked. However I have another issue. I am using scroll bars and the status bar now appears above the horizontal scroll bar. Does anybody know how I can fix this?

Thanks
How can I set the status bar`s text?
Im Anfang war die Tat...Faust
madfisher: i believe you cant have standard scrollbars and statusbar. You have to create your own scrollbar with CreateWindowEx like this (taken from my help files):


        hwndScroll = CreateWindowEx(     0L,                          // no extended styles     "SCROLLBAR",                 // scroll bar control class     (LPSTR) NULL,                // text for window title bar     WS_CHILD | SBS_HORZ,         // scroll bar styles     0,                           // horizontal position     0,                           // vertical position     200,                         // width of the scroll bar     CW_USEDEFAULT,               // default height     hwnd,                   // handle of main window     (HMENU) NULL,           // no menu for a scroll bar     hinst,                  // instance owning this window     (LPVOID) NULL           // pointer not needed );   


but instead of a 0, 0 for the position you place it so that it shows above the status bar

Hippokrates:


          SendMessage ( StatusBarHandle, SB_SETTEXT, 0, (LPARAM)(LPSTR) str );  


where str is the text you want it to have



Runicsoft -- home of my open source Function Parser and more



[edited by - Burning_Ice on September 13, 2002 9:52:13 AM]

This topic is closed to new replies.

Advertisement