PDA

Click to See Complete Forum and Search --> : Status bar help


ChimpFace9000
Feb 18th, 2001, 03:36 PM
I just added a status bar to my window using CreateStatusWindow, now how do i split it into sections so i can display multiple information.

Feb 18th, 2001, 06:03 PM
Send a SB_SETPARTS message to the status bar.


SB_SETPARTS


Sets the number of parts in a status window and the coordinate of the right edge of each part.

SB_SETPARTS
wParam = (WPARAM) nParts;
lParam = (LPARAM) (LPINT) aWidths;

Parameters
nParts
Number of parts to set (cannot be greater than 256).
aWidths
Pointer to an integer array. The number of elements is specified in nParts. Each element specifies the position, in client coordinates, of the right edge of the corresponding part. If an element is -1, the right edge of the corresponding part extends to the border of the window.
Return Values
Returns TRUE if successful, or FALSE otherwise.

Requirements
Windows NT/2000: Requires Windows NT 3.51 or later
Windows 95/98: Requires Windows 95 or later
Header: Declared in commctrl.h.



After than, send a SB_SETTEXT message.


SB_SETTEXT


The SB_SETTEXT message sets the text in the specified part of a status window.

SB_SETTEXT
wParam = (WPARAM) iPart | uType;
lParam = (LPARAM) (LPSTR) szText;

Parameters
iPart
Zero-based index of the part to set. If this parameter is set to SB_SIMPLEID, the status window is assumed to be a simple window with only one part.
uType
Type of drawing operation. This parameter can be one of the following values: 0 The text is drawn with a border to appear lower than the plane of the window.
SBT_NOBORDERS The text is drawn without borders.
SBT_OWNERDRAW The text is drawn by the parent window.
SBT_POPOUT The text is drawn with a border to appear higher than the plane of the window.
SBT_RTLREADING The text will be displayed in the opposite direction to the text in the parent window.

szText
Pointer to a null-terminated string that specifies the text to set. If uType is SBT_OWNERDRAW, this parameter represents 32 bits of data. The parent window must interpret the data and draw the text when it receives the WM_DRAWITEM message. The text for each part is limited to 127 characters.
Return Values
Returns TRUE if successful, or FALSE otherwise.

Remarks
The message invalidates the portion of the window that has changed, causing it to display the new text when the window next receives the WM_PAINT message.

Normal windows display text left-to-right (LTR). Windows can be mirrored to display languages such as Hebrew or Arabic that read right-to-left (RTL). If SBT_RTLREADING is set, the szText string will read in the opposite direction from the text in the parent window.

Requirements
Windows NT/2000: Requires Windows NT 3.51 or later
Windows 95/98: Requires Windows 95 or later
Header: Declared in commctrl.h.

See Also
SB_GETTEXT