PROCEDURE CreateStatusWindow EXTERNAL "comctl32.dll":
DEFINE INPUT PARAMETER lStyle AS LONG.
DEFINE INPUT PARAMETER lpctStr AS CHARACTER.
DEFINE INPUT PARAMETER hwndParent AS LONG.
DEFINE INPUT PARAMETER wId AS LONG.
DEFINE RETURN PARAMETER hStatusArea AS LONG.
END PROCEDURE.
FUNCTION CreateStatusBar RETURNS INTEGER
( /* parameter-definitions */ ) :
/*------------------------------------------------------------------------------
Purpose:
Notes:
------------------------------------------------------------------------------*/
DEFINE VARIABLE hwndMenu AS INTEGER NO-UNDO.
DEFINE VARIABLE hwndParent AS INTEGER NO-UNDO.
DEFINE VARIABLE hInstance AS INTEGER NO-UNDO.
DEFINE VARIABLE hWindowMenu AS INTEGER NO-UNDO.
DEFINE VARIABLE hStatusArea AS INTEGER NO-UNDO.
DEFINE VARIABLE lpParam AS MEMPTR NO-UNDO.
DEFINE VARIABLE ReturnValue AS INTEGER NO-UNDO.
ASSIGN
SET-SIZE(lpParam) = 256
PUT-LONG(lpParam,1) = 120
PUT-BYTE(lpParam,5) = 240.
/*PUT-LONG(lpParam,9) = -1. extend to the right edge of the window */
/* find handle to the Parent handle of the Window */
RUN GetParent IN hpApi(iwinhand,
OUTPUT hwndParent).
RUN GetWindowLongA IN hpApi(hwndParent,
-6, /* GWL_HINSTANCE */
OUTPUT hInstance).
/* Call InitCommonControls to ensure that the comctl32.dll is loaded */
RUN InitCommonControls.
/* hwndParent */
/* Create the status window control and parent it to the window */
RUN CreateStatusWindow
( 1073741824 /* = WS_CHILD */
+ 268435456 /* = WS_VISIBLE */ /* window styles */
+ 8388608 , /* = WS_BORDER */
cFillInHelp, /* text to display in status area of win */
hwndParent, /* parent window */
101, /* ID_STATUS */
OUTPUT hStatusArea).
/*MESSAGE hStatusArea "hStatusArea"
VIEW-AS ALERT-BOX INFO BUTTONS OK.*/
IF hStatusArea = 0 THEN
MESSAGE 'Unable to create the status bar...' VIEW-AS ALERT-BOX.
ELSE
/* create the multiple segments based on the data in lpParam */
RUN SendMessageA IN hpApi( INPUT hStatusArea,
INPUT {&SB_SETPARTS},
INPUT 0, /* number of parts */
INPUT GET-POINTER-VALUE(lpParam)).
/*OUTPUT ReturnValue).*/
ASSIGN
SET-SIZE(lpParam) = 0.
RETURN hStatusArea. /* Function return value. */
END FUNCTION.