BCX_STATUS function

Purpose:

BCX_STATUS creates a Status bar at the bottom of the owner window.

Syntax:

hStatus = BCX_STATUS(Text AS STRING, _
                 hwndParent AS HWND _
           [, cidStatBar AS INTEGER] _
             [, numparts AS INTEGER] _
                [, parts AS INTEGER])

Return Value:

  • Data type: HWND
    hStatus HWND data type handle if the function is successful, if not successful, NULL is returned.

Parameters:

  • Data type: STRING
    Text Text string to be set in the status bar control.
  • Data type: HWND
    hwndParent The handle of the parent control in which the status bar is created.
  • Data type: INTEGER
    cidStatBar Control identifier for the status bar. This value is used by the window procedure to identify messages it sends to the parent window. The default is set to 200.
  • Data type: INTEGER
    numparts [OPTIONAL] specifies the number of parts to create.
  • Data type: INTEGER array
    parts [OPTIONAL] Array of integers containing an element for each part, with each element specifying the position of the right edge of a part. Here is an example of how to implement this parameter.
    SET parts[4]
     100,200,300,-1
    END SET
    hStatus = BCX_STATUS(Text$, hwndParent, cidStatBar, 4, parts)
    

Remarks:

When a form, which includes a menu, is built, the BCX_STATUS function call must be placed after the menu building procedure calls.

Example:

GUI "BCX_STATUS"

DIM Form1    AS CONTROL
DIM Stat1    AS CONTROL
DIM MainMenu AS HMENU
DIM HelpMenu AS HMENU

SUB FORMLOAD
  Form1 = BCX_FORM("Simple Status Sample")
  MainMenu = CreateMenu()
  Insertmenu(MainMenu, 0, MF_POPUP, HelpMenu, "&Help")
  SetMenu(Form1, MainMenu)
  Stat1 = BCX_STATUS("Ready",Form1)
  CENTER(Form1)
  SHOW(Form1)
END SUB

BEGIN EVENTS
  SELECT CASE CBMSG
    CASE WM_LBUTTONDOWN
    SetWindowText(Stat1,"left mouse button down :-(")

    CASE WM_LBUTTONUP
    SetWindowText(Stat1,"LEFT MOUSE BUTTON UP   :-)")

    CASE WM_MOUSEMOVE
    ' horizontal position of cursor, X Position = LOWORD(lParam)
    ' vertical position of cursor, Y Position = HIWORD(lParam)
   SetWindowText(Stat1, STR$(LOWORD(lParam)) & " " & STR$(HIWORD(lParam)))
  END SELECT
END EVENTS

Result:

If the control was created, the return value is the handle of the new control. If the function fails, the return value is NULL.

For an example of the BCX_STATUS function see Demo.bas.