BCX_STATUS function

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


 Syntax:

 hStatus = BCX_STATUS(Text$, _
                   hWndParent _
               [, cidStatBar] _
         [, numparts%, parts])

 Parameters:

  • hStatus If the function is successful, the handle for the status window is returned. If not successful, NULL is returned.
  • Text$ Text string to be set in the status bar control.
  • hWndParent Handle of the parent control in which the status bar is created.
  • 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.
  • numparts [OPTIONAL] specifies the number of parts to create.
  • parts [OPTIONAL] a pointer to an 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
 
 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 to the new control. If the function fails, the return value is NULL.

For an example of the BCX_STATUS function see Demo.bas in the BCX\Gui_Demo\EZ_Gui folder.