home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / windows / c / bsscdemo / bslist.h < prev    next >
Encoding:
Text File  |  1993-05-28  |  48.6 KB  |  1,302 lines

  1. /*
  2.  Copyright (c) 1992, 1993 by Barking Spider Software, Inc. All rights reserved
  3.                                        
  4.    Filename...:  bslist.h
  5.    
  6.    Version....:  1.0
  7.    
  8.    Language...:  Microsoft C/C++ 7.0
  9.    
  10.    Model......:  Small
  11.    
  12.    Environment:  Microsoft Windows 3.1
  13.                                        
  14.    Description:  This header file describes the exported APIs supported by
  15.                  the list control.  For a description of error codes, 
  16.                  notification messages, structures, etc. reference the header
  17.                  file BSCORE.H.
  18.    Notes......:  
  19.                                        
  20.    History....:
  21.                                           
  22.    Author.....:  Peter J. Kaufman
  23.                                           
  24. */
  25.  
  26. /****************************************************************************/
  27. /*                        LIST CONTROL EXPORTED APIs                        */
  28. /****************************************************************************/
  29. /*
  30.   BSL_AddListItems ( )
  31.   BSL_ChangeListItemText ( )
  32.   BSL_ChangeUserData ( )
  33.   BSL_ConvertPointToSelectNotif ( )
  34.   BSL_CreateListBox ( )
  35.   BSL_DeleteListItem ( )
  36.   BSL_DragAcceptFiles ( )
  37.   BSL_GetCurSel ( )
  38.   BSL_GetListItem ( )
  39.   BSL_GetListItemCount ( )
  40.   BSL_GetVersion ( )
  41.   BSL_InsertListItems ( )
  42.   BSL_ResetList ( )
  43.   BSL_SetBitmap ( )
  44.   BSL_SetBitmapAndActiveBitmap ( )
  45.   BSL_SetBitmapSpace ( )
  46.   BSL_SetCurSel ( )
  47.   BSL_SetDeleteListItemCallBack ( )
  48.   BSL_SetFont ( )
  49.   BSL_SetIcon ( )
  50.   BSL_SetXSpaceBeforeText ( )
  51. */
  52.  
  53.  
  54.  
  55. /*---------------------------------------------------------------------------
  56.  short _export FAR PASCAL BSL_AddListItems  ( HWND hwndList, 
  57.                                               WORD wNodeDefCount,
  58.                                               LP_TREE_NODE_DEF lpTreeNodeDef); 
  59.   Description:
  60.  
  61.     This API allows the application to add one or more list items to the given
  62.     list.
  63.   
  64.   Arguments:
  65.   
  66.     HWND hwndList:
  67.   
  68.       This argument indicates which list control will create the new
  69.       list items and append them to the end of the list.  This is the window
  70.       handle that was returned to the application after calling
  71.       BSL_CreateListBox ( ).  BSL_CreateListBox ( ) creates an empty list.
  72.     
  73.     WORD wNodeDefCount:
  74.  
  75.       wNodeDefCount contains the number of list items to be added.  In other
  76.       words, wNodeDefCount is the number of TREE_NODE_DEF array elements in
  77.       the TREE_NODE_DEF array pointed to by lpTreeNodeDef.
  78.      
  79.     LP_TREE_NODE_DEF lpTreeNodeDef:
  80.   
  81.       lpTreeNodeDef is a pointer to an array of TREE_NODE_DEFs that describe
  82.       each of the list items to be added.
  83.     
  84.       If the list already has list items, then the new list items are
  85.       appended to end of the list.
  86.     
  87.       While adding list items to the list control, the list control could
  88.       receive either a memory allocation failure or realize that the total
  89.       number of list items in the list has exceeded the maximum number of
  90.       list items allowed.  If either of these conditions occur then the
  91.       list items that were added to the list control prior to the
  92.       problem, are NOT removed from the list.  The application will receive
  93.       error messages if there is a memory allocation problem or the maximum
  94.       number of list items is exceeded.  The application can determine what
  95.       list items did not make it into the list by looking at the value
  96.       of the lpTreeNode member of each TREE_NODE_DEF array starting from the
  97.       beginning of the array.  When a TREE_NODE_DEF's lpTreeNode member is
  98.       found that has a value of zero, then that TREE_NODE_DEF and all 
  99.       subsequent TREE_NODE_DEFs in the TREE_NODE_DEF array were not used to
  100.       create new list items.
  101.     
  102.   Comments:
  103.  
  104.     Where do TREE_NODE pointers come from?  There are several ways to retrieve
  105.     TREE_NODE pointers.
  106.          
  107.     1) TREE_NODE pointers are supplied to the application by the list control.
  108.     They are returned to the application via the lpTreeNode member of the
  109.     TREE_NODE_DEF structure, when the application successfully calls 
  110.     BSL__AddListItems ( ) or BSL_InsertListItems ( ), which add list items to
  111.     the given list.  The application can store these TREE_NODE pointers for
  112.     future references.  Via the TREE_NODE pointers, the index where the
  113.     list item is position in the list can be accessed.
  114.     
  115.     2) The application will receive the pointer to the list control owned
  116.     SELECT_NOTIF structure as the result of a notification of an event.
  117.     From the SELECT_NOTIF structure, the TREE_NODE pointer to the list item
  118.     involved in the event is available.  Below is a list of notifications
  119.     with the associated events:
  120.   
  121.         Notification                         Event
  122.       
  123.      WM_BST_SELECT_NOTIF 
  124.                                - Single click left mouse button while over a
  125.                                  list item.
  126.                                - Select list item with up or down arrow.
  127.                                - Select list item with page up or page down
  128.                                  key.
  129.                                - Select list item with home or end key.
  130.                                - Select list item with Ctrl Up or Ctrl Down.
  131.                  
  132.      WM_BST_SELECT_NOTIF_DBLCLK
  133.                                - Double click left mouse button while over
  134.                                  list item.  Sends WM_BST_SELECT_NOTIF on
  135.                                  first click.
  136.                                - Hit carriage return while a list item is
  137.                                  selected.
  138.                                - '+' key.
  139.      WM_BST_DODRAG              
  140.                                - Depress the left mouse button over a list
  141.                                  item and while continuing to hold down the
  142.                                  left button, move the mouse a predetermined
  143.                                  distance.  
  144.   
  145.   
  146.     3) Calling BSL_GetListItem ( ) will return the TREE_NODE pointer of the
  147.     list item specified by the given index.
  148.  
  149.     4) Calling BSL_ConvertPointToSelectNotif ( ) will return a pointer to
  150.     the list control owned SELECT_NOTIF structure which in turn, the pointer
  151.     to the list item that lies under the coordinate supplied by the
  152.     application can be retrieved.
  153.     
  154.     5) BSL_SetDeleteNodeCallBack ( ) allows the application to register a
  155.     callback with the given list control.  The callback will be called
  156.     everytime a list item is deleted from the list.  List items can be
  157.     deleted from the list with two list control export APIs or with the
  158.     Windows API DestroyWindow ( ).  The two list control exported APIs are:
  159.      
  160.     BSL_DeleteListItem ( )
  161.     BSL_ResetList ( )
  162.          
  163.   Return Codes:
  164.   
  165.      BST_NO_ERROR                  
  166.      BST_ERR_MEMORY_ALLOC_FAILED 
  167.      BST_ERR_LEVEL_LIMIT_EXCEEDED
  168.      BST_ERR_TOO_MANY_NODES
  169.      BST_ERR_ONLY_ONE_ROOT_ALLOWED             
  170.      BST_ERR_INVALID_PARENT_FOR_INSERTION      
  171.      BSL_ERR_INVALID_INDEX
  172. */
  173.  
  174.  
  175. short _export FAR PASCAL BSL_AddListItems  ( HWND hwndList, 
  176.                                              WORD wNodeDefCount,
  177.                                              LP_TREE_NODE_DEF lpTreeNodeDef);
  178.                           
  179.  
  180.  
  181.  
  182. /*---------------------------------------------------------------------------
  183. short _export FAR PASCAL BSL_ChangeListItemText( HWND hwndList, 
  184.                                                  WORD wIndex,
  185.                                                  WORD wTextLength,
  186.                                                  LPSTR lpszText);
  187.  
  188.   Description:
  189.  
  190.     This API allows the application to change the text of the list item
  191.     which is indexed by the argument wIndex.
  192.   
  193.   Arguments:
  194.   
  195.     HWND hwndList:
  196.   
  197.       This argument specifies the list control that contains the list item
  198.       that will have the text changed.
  199.  
  200.     WORD wIndex:
  201.  
  202.       Specifies the zero based index of the list item that will be assigned
  203.       the given text.
  204.  
  205.     WORD wTextLength:
  206.   
  207.       This argument states the number of characters for the list control
  208.       to display as text for the given list item, indexed by wIndex.  The
  209.       source of the list item text is the lpszText argument described below.
  210.       Normally, the application does a lstrlen ( ) on lpszText and assigns
  211.       the result to wTextLength.  But there may be cases that the string 
  212.       pointed to by lpszText is just too long and fewer characters are
  213.       required.
  214.     
  215.       There is a special attribute of wTextLength in which the most
  216.       significant bit or the sign bit acts as a flag.  Depending on how
  217.       this bit is set there are two ways to handle text in a list item.
  218.       In both cases, the application passes a long pointer to the text
  219.       via the lpszText argument. The two methods are,
  220.                 
  221.       1) If the sign bit of wTextLength is set to 1,  then the pointer
  222.       in lpszText points to memory owned by the application and is
  223.       guaranteed not to change (be deleted or moved).  This signals the
  224.       list control to use the supplied string pointer to display the text and
  225.       not worry about allocating, copying, and freeing its memory.
  226.                 
  227.       2) If the sign bit of wTextLength is set to 0, then the list control
  228.       allocates wTextLength + 1 worth of memory.  The list control then
  229.       copies wTextLength worth of characters from the string pointed to by
  230.       the lpszText argument to the allocated memory.  This allocated memory
  231.       is owned by the list control, therefore the application does not have
  232.       to manage it.  When the list item, indexed by the argument wIndex,
  233.       is deleted, the list control will free the memory pointed to by
  234.       lpszText in the TREE_NODE.
  235.                 
  236.       The 1) method is usually used with static databases and the 2)
  237.       method is used with real-time systems.  And of course, both methods
  238.       can be intermixed.
  239.                 
  240.       NOTE:  If the low 15 bits of wTextLength are set to 0 then lpszText is
  241.       set to NULL by the list control.
  242.                 
  243.     LPSTR   lpszText:
  244.      
  245.       lpszText is a long pointer to a string that will be displayed
  246.       in the list control for the given list item.  The application must
  247.       specify the length of string to be displayed in wTextLength.
  248.       Please refer to the wTextLength documentation above for an
  249.       understanding of the different methods that can be applied to the
  250.       handling of lpszText.     
  251.     
  252.   Comments:
  253.  
  254.     If a memory allocation failure occurs, then the lpszText member of
  255.     TREE_NODE will be assigned a NULL and NO text will be displayed for the
  256.     given list item.
  257.      
  258.     If the low 15 bits of wTextLength are set to 0 then lpszText is set to
  259.     NULL by the list control.
  260.       
  261.   Return Codes:
  262.   
  263.     BST_NO_ERROR
  264.     BST_ERR_MEMORY_ALLOC_FAILED
  265.     BSL_ERR_INVALID_INDEX
  266. */
  267.  
  268. short _export FAR PASCAL BSL_ChangeListItemText( HWND hwndList, 
  269.                                                  WORD wIndex,
  270.                                                  WORD wTextLength,
  271.                                                  LPSTR lpszText);
  272.  
  273.                           
  274. /*---------------------------------------------------------------------------
  275.  
  276. short _export FAR PASCAL BSL_ChangeUserData ( HWND hwndList, 
  277.                                               WORD wIndex,
  278.                                               WORD wUserDataSize,
  279.                                               LPSTR lpUserData); 
  280.   Description:
  281.  
  282.      This API allows the application to change the user-defined data stored
  283.      by the lpUserData member of the list item pointed to by the argument
  284.      lpUserData.
  285.   
  286.   Arguments:
  287.   
  288.     HWND hwndList:
  289.   
  290.       This argument specifies the list control that contains the list item
  291.       that will be assigned the new user-defined data.
  292.   
  293.     WORD wIndex:
  294.  
  295.       Specifies the zero based index of the list item that will be assigned
  296.       the given user-defined data.
  297.            
  298.     WORD wUserDataSize:
  299.   
  300.       If wUserDataSize is 0 then the given pointer, lpUserData, is assigned
  301.       to the list item indexed by wIndex.  It will then be the
  302.       responsibility of the application to free the memory pointed to by
  303.       lpUserData.
  304.    
  305.       If wUserDataSize is not zero, it then signals the list control to
  306.       allocate wUserDataSize worth of memory.  The list control will then
  307.       copy wUserDataSize bytes from the location pointed to by the given
  308.       argument, lpUserData, in to the newly allocated memory.   The list
  309.       control will free this allocated memory when the list item is deleted.
  310.                 
  311.     LPSTR lpUserData:
  312.      
  313.       Points to the application defined memory that the application wishes 
  314.       stored with the list item indexed by wIndex.
  315.    
  316.       If the wUserDataSize argument is set to 0 then the lpUserData pointer
  317.       will be directly assigned to the lpUserData member of the list item
  318.       indexed by wIndex.  It will be the responsibility of the application to 
  319.       free the memory pointed to by lpUserData.  
  320.    
  321.       If wUserDataSize is non-zero, then the list control will allocate
  322.       wUserDataSize worth of memory, copy wUserDataSize worth of memory from
  323.       the location pointed to by the argument lpUserData to the newly
  324.       allocated memory, and then assign the pointer to the newly allocated
  325.       memory to the lpUserData member of the list item indexed by wIndex.
  326.     
  327.   Comments:
  328.  
  329.     BSL_SetDeleteNodeCallBack ( ) allows the application to register a
  330.     callback with the given list control.  The callback will be called
  331.     everytime a list item is deleted from the list.  List items can be deleted
  332.     from the list with two list control export APIs or with the Windows API
  333.     DestroyWindow ( ).  The two list control exported APIs are:
  334.      
  335.     BSL_DeleteListItem ( )
  336.     BSL_ResetList ( )
  337.       
  338.   Return Codes:
  339.   
  340.      BST_NO_ERROR                  
  341.      BST_ERR_MEMORY_ALLOC_FAILED 
  342.      BSL_ERR_INVALID_INDEX
  343. */
  344.  
  345.                                              
  346. short _export FAR PASCAL BSL_ChangeUserData ( HWND hwndList, 
  347.                                               WORD wIndex,
  348.                                               WORD wUserDataSize,
  349.                                               LPSTR lpUserData);
  350.  
  351.  
  352.  
  353. /*---------------------------------------------------------------------------
  354.  
  355. LP_SELECT_NOTIF _export FAR PASCAL BSL_ConvertPointToSelectNotif ( 
  356.                                                                HWND  hwndList,
  357.                                                                short x,
  358.                                                                short y);
  359.    
  360.   Description:
  361.   
  362.     This API allows the application to request the given x, y coordinate 
  363.     to be converted into a pointer to the list control's SELECT_NOTIF
  364.     structure.  The SELECT_NOTIF structure will contain a pointer to the
  365.     TREE_NODE that the coordinated landed on and a wFlags member that
  366.     describes where on the list item the point landed.  The x, y coordinate
  367.     is relative to the client area of the list control specified by the
  368.     hwndList argument.
  369.   
  370.   Arguments:
  371.   
  372.     HWND hwndList:
  373.      
  374.       This is the window handle of the list control that will evaluate the
  375.       given x, y coordinate.  hwndList is the result of calling the exported
  376.       API BSL_CreateListBox ( ).
  377.   
  378.     short x:
  379.   
  380.       X axis of the point to be converted to a pointer to the list
  381.       control's SELECT_NOTIF structure.  The value is pixel based and
  382.       relative to the list control's upper left corner of the client area.
  383.      
  384.     short y:
  385.  
  386.       Y axis of the point to be converted to a pointer to the list
  387.       control's SELECT_NOTIF structure.  The value is pixel based and
  388.       relative to the list control's upper left corner of the client area.
  389.      
  390.   Comments:
  391.      
  392.     Normally, this API will be used in drag and drop operations.  To process
  393.     the drop notification message from the File Manager, which is
  394.     WM_DROPFILES, the application will need BSL_ConvertPointToSelectNotif ( )
  395.     to determine what list item the files were dropped on.  Just as well,
  396.     if the application decides to allow the dragging of a list item, the
  397.     application will need to determine what the mouse cursor shape should be
  398.     when the cursor is over other list control list items.  Since the
  399.     application captures the mouse and monitors the WM_MOUSEMOVE messages, it
  400.     can get the window handle of the window that the mouse is over, determine
  401.     the x, y point in the client area where the mouse is located, and call
  402.     BSL_ConvertPointToSelectNotif ( ) to retrieve the TREE_NODE pointer via
  403.     the SELECT_NOTIF structure.  Of course, OLE 2.0 will require the
  404.     utilization of this API.
  405.   
  406.     REMEMBER: The memory pointed to by SELECT_NOTIF pointer belongs to the
  407.     list control and is read only.  Do not write to it or free the memory
  408.     or the list control's integrity will be violated.
  409.      
  410.   Return Codes:
  411.   
  412.     NULL will be returned if the coordinate is not over a list item.
  413.      
  414.     If the x, y coordinate landed on a list item, then the return value will
  415.     be the LP_SELECT_NOTIF pointer which will contain the hit flags and a
  416.     pointer to the list item that the x, y coordinate landed on.
  417. */
  418.  
  419. LP_SELECT_NOTIF _export FAR PASCAL BSL_ConvertPointToSelectNotif ( 
  420.                                                                HWND  hwndList,
  421.                                                                short x,
  422.                                                                short y);
  423.  
  424.  
  425. /*--------------------------------------------------------------------------- 
  426.  HWND _export FAR PASCAL BSL_CreateListBox ( HANDLE hInstance,
  427.                                              HWND hwndApp,
  428.                                              int x, int y,
  429.                                              int nWidth, int nHeight,
  430.                                              DWORD dwStyle,
  431.                                              DWORD dwExStyle);
  432.   Description:
  433.   
  434.     Creates an empty list.  BSL_CreateListBox ( ) ORs the style bits specified
  435.     in dwStyle to the list control's required styles and calls the Windows
  436.     API, CreateWindowEx ( ).  In effect, BSL_CreateListBox calls ( )
  437.     CreateWindowEx ( ) as:
  438.                       
  439.     CreateWindowEx ( dwExStyle,
  440.                      "BST_Tree",
  441.                      "",
  442.                      dwStyle | dwTreeControlStyles,
  443.                      x,
  444.                      y,
  445.                      nWidth,
  446.                      nHeight,
  447.                      hwndApp,
  448.                      NULL,
  449.                      hInstance,
  450.                      NULL);
  451.  
  452.     Once the list is created then list items can be added by calling the
  453.     exported APIs:
  454.   
  455.     BSL_AddListItems ( )
  456.     BSL_InsertListItems ( )
  457.   
  458.   Arguments:
  459.   
  460.     HANDLE hInstance:
  461.   
  462.       Instance associated with the creation of the list control window.
  463.   
  464.     HWND hwndApp:
  465.   
  466.       Window handle of the parent window that is creating the list control.
  467.   
  468.     int x:
  469.   
  470.       X location of the upper left corner of the list control in client area
  471.       coordinates of the parent window.
  472.   
  473.     int y:
  474.   
  475.       Y location of the upper left corner of the list control in client
  476.       area coordinates of the parent window.
  477.   
  478.     int nWidth:
  479.   
  480.       Width of the list control in device (pixel) units.
  481.   
  482.     int nHeight:
  483.   
  484.       Height of the list control in device (pixel) units.
  485.   
  486.     DWORD dwStyle:
  487.   
  488.       Application requested CreateWindowEx ( ) styles.
  489.   
  490.     DWORD dwExStyle:
  491.   
  492.       Application requested CreateWindowEx ( ) extended styles.
  493.   
  494.   Comments:
  495.   
  496.     The successful return value from this call, which is a window handle,
  497.     will be used as the list control identifier for applying the 
  498.     list control exported APIs.  Most of the list control APIs require
  499.     the list control window handle.
  500.      
  501.   Return Codes:
  502.   
  503.     If successful, BSL_CreateListBox ( ) will return the window handle of the
  504.     newly created list control.  If failure, then a NULL will be returned.
  505. */
  506.  
  507. HWND _export FAR PASCAL BSL_CreateListBox ( HANDLE hInstance,
  508.                                             HWND hwndApp,
  509.                                             int x, int y,
  510.                                             int nWidth, int nHeight,
  511.                                             DWORD dwStyle,
  512.                                             DWORD dwExStyle);
  513.                                             
  514.                                             
  515. /*---------------------------------------------------------------------------
  516.  
  517.   short _export FAR PASCAL BSL_DeleteListItem ( HWND hwndList, 
  518.                                                 WORD wIndex);       
  519.                                                 
  520.   Description:
  521.                      
  522.     Delete the list item indexed by wIndex from the given list control.
  523.   
  524.   Arguments:
  525.  
  526.     HWND hwndList:
  527.      
  528.       This argument specifies the list control that will destroy the list
  529.       item indexed by wIndex.
  530.       
  531.     WORD wIndex:
  532.  
  533.       Specifies the zero based index of the list item that will be deleted
  534.       from the list specified by the argument hwndList.
  535.     
  536.   Comments:
  537.  
  538.      When a list item is deleted the list control frees the deleted list
  539.      item's memory.  If a notification of a list item's deletion is desired,
  540.      then the application can use the list control exported API,
  541.      BSL_SetDeleteNodeCallBack ( ), to register a callback function that the
  542.      list control will call just before deletion of the list item.  If the
  543.      application has assigned a pointer to dynamically allocated memory in
  544.      the lpUserData member of the list item, it is the responsibility of the
  545.      application to free this memory.
  546.       
  547.   Return Codes:
  548.   
  549.      BST_NO_ERROR
  550.      BSL_ERR_INVALID_INDEX
  551. */
  552.                                             
  553. short _export FAR PASCAL BSL_DeleteListItem ( HWND hwndList, 
  554.                                               WORD wIndex);
  555.  
  556.  
  557. /*---------------------------------------------------------------------------
  558.   void _export FAR PASCAL BSL_DragAcceptFiles( HWND hwndList, BOOL bAccept);
  559.   
  560.   Description:
  561.  
  562.     Registers the list control to accept dropped files.
  563.   
  564.   Arguments:
  565.  
  566.     HWND hwndList:
  567.      
  568.       This argument specifies the list control that will accept the message,
  569.       WM_DROPFILES.
  570.       
  571.     BOOL bAccept:
  572.   
  573.       If set to TRUE then the given list control will accept the
  574.       WM_DROPFILES message.
  575.     
  576.   Comments:
  577.      
  578.     The Windows File Manager (WINFILE.EXE) will send the WM_DROPFILES message
  579.     to the window that registers when files are dropped onto it.
  580.      
  581.   Return Codes:
  582.   
  583.      None
  584. */
  585.  
  586. void _export FAR PASCAL BSL_DragAcceptFiles ( HWND hwndList, BOOL bAccept);
  587.  
  588.  
  589.  
  590. /*---------------------------------------------------------------------------
  591.   short _export FAR PASCAL BSL_GetCurSel ( HWND hwndList ) ;
  592.  
  593.  
  594.   Description:
  595.   
  596.     Returns the zero based index of the active/highlighted list item of the
  597.     given list.  If there are no list items in the list, the return value
  598.     will be -1.
  599.   
  600.   Arguments:
  601.   
  602.     HWND hwndList:
  603.   
  604.       This argument specifies the list control that contains the current
  605.       selection.
  606.      
  607.   Comments:
  608.   
  609.     If the deletion of the active list item occurs, then the next
  610.     list item becomes the next active item.  If there is no next item, then
  611.     the previous item to the deleted item becomes the active/highlighted item.
  612.   
  613.   Return Codes:
  614.   
  615.     Returns the zero based index of the active/highlighted list item of the
  616.     given list.  If there are no list items in the list, the return value
  617.     will be -1.  
  618. */
  619.  
  620. short _export FAR PASCAL BSL_GetCurSel ( HWND hwndList ) ;
  621.  
  622.  
  623.  
  624. /*---------------------------------------------------------------------------
  625.   LP_TREE_NODE _export FAR PASCAL BSL_GetListItem ( HWND hwndList, 
  626.                                                     WORD wIndex);
  627.  
  628.   Description:
  629.   
  630.     Returns a pointer to the TREE_NODE structure that belongs to the 
  631.     list item indexed by wIndex.  The TREE_NODE structure contains the
  632.     pointer to the user-defined data, the pointer to the list item text,
  633.     the length of the text, etc.
  634.     
  635.     typedef struct TreeNodeTag   
  636.     {
  637.        LPSTR   lpUserData;          
  638.        WORD    wTextLength;         
  639.        LPSTR   lpszText;            
  640.        WORD    wState;              
  641.        WORD    wIndex;              
  642.        BYTE    chBitmapTypeBits;    
  643.        HBITMAP hBitmap[MAX_BITMAPS];
  644.        HBITMAP hActiveBitmap[MAX_BITMAPS];
  645.     }
  646.     TREE_NODE;    
  647.   
  648.   Arguments:
  649.   
  650.     HWND hwndList:
  651.   
  652.       This argument specifies the list control that contains the list item
  653.       indexed by wIndex.
  654.       
  655.     WORD wIndex:
  656.  
  657.       Specifies the zero based index of the list item that will have a
  658.       pointer to it's associated TREE_NODE structure returned to the
  659.       application.
  660.       
  661.   Comments:
  662.   
  663.      Reference the header file BSCORE.H for more documentation on
  664.      the TREE_NODE structure.
  665.        
  666.   Return Codes:
  667.   
  668.     Returns NULL if the wIndex value is not valid else a pointer to the
  669.     TREE_NODE associated with the list item indexed by wIndex will be
  670.     returned.
  671. */
  672.  
  673. LP_TREE_NODE _export FAR PASCAL BSL_GetListItem ( HWND hwndList, 
  674.                                                   WORD wIndex);
  675.                                 
  676.  
  677. /*---------------------------------------------------------------------------
  678.   short _export FAR PASCAL BSL_GetListItemCount ( HWND hwndList ) ;
  679.  
  680.   Description:
  681.   
  682.     Returns the number of list items in the given list.
  683.     
  684.   Arguments:
  685.   
  686.     HWND hwndList:
  687.   
  688.       This argument specifies the list control that contains the list items.
  689.       
  690.   Comments:
  691.   
  692.     By using the return value of BSL_GetListItemCount ( ) as the upper 
  693.     limit, an application can traverse the list starting at 0.
  694.        
  695.   Return Codes:
  696.   
  697.     Returns 0 if no list items are in the list, else the number of list
  698.     items in the list will be returned.
  699. */
  700.  
  701. short _export FAR PASCAL BSL_GetListItemCount ( HWND hwndList ) ;
  702.  
  703.  
  704. /*---------------------------------------------------------------------------
  705.   WORD _export FAR PASCAL BSL_GetVersion( void );
  706.  
  707.   Description:
  708.   
  709.     Returns the version number of the list control. The returned word
  710.     contains the the version number. The high order byte of the word
  711.     contains the minor version and the low order byte of the word
  712.     contains the major version number.
  713.   
  714.   Arguments:
  715.  
  716.     void:
  717.      
  718.       Only one list control DLL can be loaded at a time so any instance
  719.       of the tree control can reflect the version.
  720.      
  721.   Comments:
  722.   
  723.     To decipher the returned WORD, use the following piece of code:
  724.      wMinorVersion = wVersion >> 8;
  725.      wMajorVersion = wVersion & 0x00FF;
  726.   
  727.   Return Codes:
  728.   
  729.     BST_NO_ERROR   
  730. */
  731.  
  732. WORD _export FAR PASCAL BSL_GetVersion ( void );
  733.  
  734.  
  735.  
  736. /*---------------------------------------------------------------------------
  737. short _export FAR PASCAL BSL_InsertListItems ( HWND hwndList, 
  738.                                                WORD wIndex,
  739.                                                WORD wNodeDefCount,
  740.                                                LP_TREE_NODE_DEF lpTreeNodeDef);
  741.   Description:
  742.  
  743.     This API allows the application to insert one or more list items into the
  744.     given list.
  745.   
  746.   Arguments:
  747.   
  748.     HWND hwndList:
  749.    
  750.       This argument specifies the list control that will create the new
  751.       list items.  This is the window handle that was returned to
  752.       the application by calling BSL_CreateListBox ( ).  BSL_CreateListBox ( )
  753.       creates an empty list.
  754.  
  755.     WORD wIndex:
  756.  
  757.       Specifies the zero based index where the list items will be inserted
  758.       into the list.  If wIndex equals -1 then the list of items will be
  759.       appended to the end of the list.
  760.      
  761.     WORD wNodeDefCount:
  762.   
  763.       wNodeDefCount contains the number of list items to be inserted.  In
  764.       other words, wNodeDefCount is the number of TREE_NODE_DEF elements in
  765.       the TREE_NODE_DEF array pointed to by lpTreeNodeDef.
  766.      
  767.     LP_TREE_NODE_DEF lpTreeNodeDef:
  768.   
  769.       This is a pointer to a list of TREE_NODE_DEFs that describe each of
  770.       the list items to be inserted. 
  771.  
  772.   Comments:
  773.        
  774.     When BSL_InsertListItems ( ) is called, the list control allocates
  775.     room for wNodeDefCount worth of list items in the list starting at the
  776.     index specified by the argument wIndex.  The list control then
  777.     creates wNodeDefCount worth of new list items.  It then serially
  778.     traverses the lpTreeNodeDef array, initializing the newly created list
  779.     items.
  780.     
  781.   Return Codes:
  782.   
  783.     BST_NO_ERROR
  784.     BST_ERR_MEMORY_ALLOC_FAILED
  785.     BST_ERR_LEVEL_LIMIT_EXCEEDED
  786.     BST_ERR_TOO_MANY_NODES
  787.     BST_ERR_ONLY_ONE_ROOT_ALLOWED
  788.     BST_ERR_INVALID_PARENT_FOR_INSERTION
  789.     BSL_ERR_INVALID_INDEX
  790. */
  791.  
  792. short _export FAR PASCAL BSL_InsertListItems ( HWND hwndList, 
  793.                                                WORD wIndex,
  794.                                                WORD wNodeDefCount,
  795.                                                LP_TREE_NODE_DEF lpTreeNodeDef);
  796.  
  797.  
  798. /*---------------------------------------------------------------------------
  799.   void _export FAR PASCAL BSL_ResetList ( HWND hwndList); 
  800.  
  801.   Description:
  802.   
  803.     Remove all of the list items in the specified list control but do not
  804.     destroy the list control.
  805.   
  806.   Arguments:
  807.  
  808.     HWND hwndList:
  809.      
  810.       This argument specifies the list control that will destroy all of it's
  811.       list items.  This list control handle can still be used in any of the
  812.       APIs such as BSL_AddListItems ( ).  It does not invalidate the list 
  813.       control window handle.
  814.       
  815.   Comments:
  816.  
  817.      When a list item is deleted, it's TREE_NODE structure is no longer valid.
  818.      
  819.      If a notification of a list item's deletion is desired, then the
  820.      application can use the list control exported API,
  821.      BSL_SetDeleteNodeCallBack ( ), to register a callback function that the
  822.      list control will call just before deletion of the list item.  If the
  823.      application has assigned a pointer to dynamically allocated memory in
  824.      the lpUserData member of the list item, it is the responsibility of the
  825.      application to free this memory.
  826.   
  827.   Return Codes:
  828.   
  829.      BST_NO_ERROR   
  830. */
  831.                                            
  832. void _export FAR PASCAL BSL_ResetList ( HWND hwndList); 
  833.  
  834.  
  835.  
  836. /*---------------------------------------------------------------------------
  837.  short _export FAR PASCAL BSL_SetBitmap ( HWND  hwndList,
  838.                                           short nBitmap,
  839.                                           WORD  wIndex,
  840.                                           HBITMAP hBitmap); 
  841.   Description:
  842.   
  843.     Assigns a bitmap handle to a specified list item for the specified
  844.     bitmap space.  Erases, but not deletes, the old bitmap or icon if it 
  845.     exists and then draws the new one.
  846.   
  847.   Arguments:
  848.  
  849.     HWND hwndList:
  850.      
  851.       hwndList is the list control in which the list item will receive the
  852.       bitmap handle.
  853.  
  854.     short nBitmap:
  855.   
  856.       nBitmap is the index into the bitmap/icon array of the list item in
  857.       which the given bitmap handle will be stored.  This index is zero
  858.       based and the maximum index is MAX_BITMAPS - 1.  
  859.  
  860.     WORD wIndex:
  861.  
  862.       Specifies the zero based index of the list item which will be 
  863.       assigned the new bitmap handle specified by the argument hBitmap.
  864.  
  865.     HBITMAP hBitmap:
  866.  
  867.       hBitmap is the handle to the bitmap which will be drawn in the
  868.       specified bitmap space for the given list item indexed by wIndex.  It
  869.       will be stored in the list item's hBitmap[] array in the member
  870.       indexed by nBitmap.
  871.     
  872.       Bitmap spaces are the regions before the list item text where the
  873.       bitmaps/icons are painted.  The left most bitmap space corresponds
  874.       with the first array member of the list item's hBitmap[] array.
  875.       The second left most bitmap space corresponds with the second array
  876.       member of the list item's hBitmap[] array, and so on.
  877.       The hBitmap[] array stores the list item's bitmap/icon handles but the
  878.       bitmap spaces are defined globally for all list items.  This keeps
  879.       column alignment which looks good and makes hit testing consistent.
  880.     
  881.       Reference the list control exported API, BSL_SetBitmapSapce ( ) to
  882.       learn the process of defining a bitmap space.
  883.      
  884.   Comments:
  885.   
  886.     Bitmap/icon handles are NOT the property of the list control.  The list
  887.     control treats the bitmap/icon handle as read only.  It will use the
  888.     handle to draw the bitmap/icon associated with the list item.  If the
  889.     list item already has a bitmap/icon handle stored in the specified bitmap
  890.     position then the old handle is simply overwritten.  It is the
  891.     responsibility of the application to manage creation and destruction of
  892.     bitmaps/icons.  If the application deletes/destroys bitmaps/icons before
  893.     the list items are destroyed, then the tree control will possibly
  894.     reference invalid bitmap/icon handles.
  895.      
  896.     For more information regarding bitmaps/icons and list items, refer to the
  897.     TREE_NODE structure documentation in the header BSCORE.H.
  898.   
  899.   Return Codes:
  900.  
  901.     BST_NO_ERROR   
  902. */
  903.  
  904. short _export FAR PASCAL BSL_SetBitmap ( HWND  hwndList,
  905.                                          short nBitmap,
  906.                                          WORD  wIndex,
  907.                                          HBITMAP hBitmap); 
  908.  
  909.  
  910. /* ---------------------------------------------------------------------------
  911. short _export FAR PASCAL BSL_SetBitmapAndActiveBitmap ( HWND  hwndList,
  912.                                                         short nBitmap,
  913.                                                         WORD wIndex,
  914.                                                         HBITMAP hBitmap,
  915.                                                         HBITMAP hActiveBitmap);
  916.   Description:
  917.   
  918.     Assigns two bitmap handles to a specified list item for the specified
  919.     bitmap space.  Erases, but not deletes, the old bitmap if defined
  920.     and draws the new bitmap.  The hBitmap handle will be used to draw the
  921.     bitmap if the list item is not active else the hActiveBitmap handle
  922.     will be used to draw the bitmap if the list item is active.
  923.      
  924.     This API provides a way to provide a background masked bitmap 
  925.     to match the highlight color used in showing list item selection.
  926.   
  927.   Arguments:
  928.  
  929.     HWND hwndList:
  930.      
  931.       hwndList is the list control in which the list item will receive the
  932.       bitmaps.
  933.  
  934.     short nBitmap:
  935.   
  936.       nBitmap is the index into the hBitmap[] array and the hActiveBitmap[]
  937.       array of the specified list item, indexed by wIndex, in which the new
  938.       bitmaps will replace the old bitmaps if they are defined.  This index
  939.       is zero based and the maximum index is MAX_BITMAPS - 1;
  940.  
  941.     WORD wIndex:
  942.  
  943.       Specifies the zero based index of the list item which will be 
  944.       assigned the new bitmap handles specified by the arguments hBitmap
  945.       and hActiveBitmap.
  946.       
  947.     HBITMAP hBitmap:
  948.     
  949.       hBitmap is the handle to the bitmap in which the above list item,
  950.       indexed by wIndex, will draw in the specified bitmap space when the
  951.       list item is not selected.  This handle will be store in the
  952.       list item's hBitmap[] array.
  953.     
  954.     HBITMAP hActiveBitmap:
  955.     
  956.       hActiveBitmap is the handle to the bitmap in which the above
  957.       list item will draw in the specified bitmap space when the list item is
  958.       active.  This handle will be store in the list item's hActiveBitmap[]
  959.       array.
  960.      
  961.   Comments:
  962.   
  963.     Bitmap handles are NOT the property of the list control.  The list
  964.     control treats the bitmap as read only.  It will use the handle to draw
  965.     the bitmap of each list item.  When a list item is assigned a new bitmap
  966.     handle, the old handle is simply overwritten.  It is the application's
  967.     responsibility to manage creation and destruction of bitmaps.  If the
  968.     application destroys the bitmaps before the list control, then there 
  969.     will be trouble in paradise.   
  970.      
  971.     For more information regarding bitmaps and list items, refer to the
  972.     TREE_NODE structure documentation.
  973.    
  974.   Return Codes:
  975.   
  976.     BST_NO_ERROR
  977. */
  978.  
  979. short _export FAR PASCAL BSL_SetBitmapAndActiveBitmap ( HWND  hwndList,
  980.                                                         short nBitmap,
  981.                                                         WORD wIndex,
  982.                                                         HBITMAP hBitmap,
  983.                                                         HBITMAP hActiveBitmap);
  984.                 
  985.                 
  986. /*---------------------------------------------------------------------------
  987. short _export FAR PASCAL BSL_SetBitmapSpace ( HWND  hwndList,
  988.                                               short nBitmap,
  989.                                               short nWidth,
  990.                                               short nHeight,
  991.                                               BOOL  bCenterBitmap);
  992.   Description:
  993.                            
  994.     Define the list control's maximum width and height (in pixels) of the
  995.     bitmap space, identified by the argument nBitmap, for all items in the
  996.     list.  This API will reserve space before the beginning of the list's
  997.     text for the drawing of the bitmap identified by nBitmap.  If the
  998.     bitmap/icon handle associated with bitmap space is NULL, the empty bitmap
  999.     space will still be represented.  If the next thing after the empty bitmap
  1000.     space is the list item text, then the list control shifts the text left
  1001.     until it is butted against a non empty bitmap space or the lines.
  1002.  
  1003.     Bitmap spaces offer the application the ability to fine tune each bitmap
  1004.     position and to define each bitmap hit test area.   Hit testing is not
  1005.     performed on the bitmap but on the bitmap space.
  1006.      
  1007.     The dimensions of a bitmap space are defined globally for all tree nodes.
  1008.     The reason for this is to keep column alignment of the bitmaps.  This
  1009.     is visually pleasing and offers consistency with hit testing.     
  1010.      
  1011.   Arguments:
  1012.  
  1013.     HWND hwndList:
  1014.      
  1015.       This argument specifies the list control in which to reserve the
  1016.       bitmap space.  This space will be used to draw a bitmap.  This space
  1017.       is before the start of the list item's text, if it has text.
  1018.  
  1019.     short nBitmap:
  1020.   
  1021.       Identifies the bitmap space.  This is a zero based index into a
  1022.       MAX_BITMAPS size array where each member of the array is a structure.
  1023.       This structure has two members which hold the width and height of the
  1024.       bitmap space.  The width and height are defined in device coordinates
  1025.       (pixels).
  1026.       
  1027.     short nWidth:
  1028.   
  1029.       nWidth is the width, in pixels, of the reserved bitmap space.
  1030.      
  1031.     short nHeight:
  1032.   
  1033.       nHeight is the height, in pixels, of the reserved bitmap space.
  1034.  
  1035.     BOOL bCentered:
  1036.   
  1037.       If set to TRUE then center the bitmap/icon in the bitmap space.
  1038.  
  1039.   Comments:
  1040.     
  1041.     The bitmap/icon will be painted in the reserved space centered
  1042.     between the top and bottom boundaries.  If bCentered is set to TRUE then
  1043.     the bitmap/icon will be centered between the left and right boundaries.
  1044.     If bCentered is set to FALSE then the bitmap/icon will be left justified
  1045.     in the bitmap space.  If the bitmap is larger than the
  1046.     width and/or the height, then the bitmap will be clipped.  If the icon
  1047.     is larger than the bitmap space there will be no clipping since the
  1048.     Windows API, DrawIcon(), does not provide it.  Therefore, if an
  1049.     icon is going to be associated with a bitmap space, make the width and
  1050.     height of the bitmap space at least as wide and tall as the values
  1051.     returned from GetSystemMetrics (SM_CXICON) and 
  1052.     GetSystemMetrics (SM_CXICON).
  1053.      
  1054.     If either nHeight or nWidth is zero, then there is no bitmap space.
  1055.      
  1056.     Remember, that the bitmap space definitions, 0 thru MAX_BITMAPS-1, are
  1057.     global to all list items in the given list control.
  1058.   
  1059.   Return Codes:
  1060.   
  1061.     BST_NO_ERROR
  1062. */
  1063.                                                        
  1064. short _export FAR PASCAL BSL_SetBitmapSpace ( HWND  hwndList,
  1065.                                               short nBitmap,
  1066.                                               short nWidth,
  1067.                                               short nHeight,
  1068.                                               BOOL  bCenterBitmap);
  1069.  
  1070.  
  1071. /*---------------------------------------------------------------------------
  1072.  short _export FAR PASCAL BSL_SetCurSel ( HWND hwndList, 
  1073.                                           WORD wIndex);
  1074.                                           
  1075.   Description:
  1076.  
  1077.     This API makes the list item indexed by the argument wIndex the active
  1078.     list item in the given list.
  1079.     
  1080.   Arguments:
  1081.   
  1082.     HWND hwndList:
  1083.   
  1084.       This argument specifies the list control in which the given list item,
  1085.       indexed by the argument wIndex, will be made active.  Only one active
  1086.       list item is allowed in each list.
  1087.  
  1088.     WORD wIndex:
  1089.  
  1090.       Specifies the zero based index of the list item which will be 
  1091.       made the new active list item in the list control hwndList.
  1092.    
  1093.   Comments:
  1094.  
  1095.       When the given list item is made active, the previously active list item
  1096.       becomes inactive.  Only one active list item is allowed in each list.
  1097.       
  1098.       If the active list item is not visible, in the client area of the tree
  1099.       control, then the active list item will be made visible.
  1100.      
  1101.   Return Codes:
  1102.  
  1103.     BST_NO_ERROR
  1104. */
  1105.  
  1106. short _export FAR PASCAL BSL_SetCurSel ( HWND hwndList, 
  1107.                                          WORD wIndex);
  1108.  
  1109.  
  1110.  
  1111. /*---------------------------------------------------------------------------
  1112.  
  1113. typedef BOOL (_export FAR PASCAL * FP_DELETE_LIST_ITEM_CB) ( HWND,
  1114.                                                              LP_TREE_NODE);
  1115. short _export FAR PASCAL BSL_SetDeleteListItemCallBack (
  1116.                                        HWND hwndList, 
  1117.                                        FP_DELETE_LIST_ITEM_CB fpDeleteItemCB);                    
  1118.                                        
  1119.   Description:
  1120.   
  1121.     This API allows the application to register a callback with the given
  1122.     list control.  The callback will be called everytime a list item is
  1123.     deleted from the list.  List items can be deleted from the list with two
  1124.     list control export APIs or with the Windows API DestroyWindow ( ).  The
  1125.     two list control exported APIs are:
  1126.      
  1127.     BSL_DeleteListItem ( )
  1128.     BSL_ResetList ( )
  1129.                            
  1130.   Arguments:
  1131.  
  1132.     HWND hwndList:
  1133.      
  1134.       hwndList identifies the list control in which to register the callback
  1135.       with.
  1136.      
  1137.     FP_DELETE_LIST_ITEM_CB fpDeleteItemCB:
  1138.      
  1139.       The address of the callback.  This will be called everytime a list item
  1140.       deletion occurs.
  1141.  
  1142.   Comments:
  1143.   
  1144.     Know how to define callbacks before using this feature!
  1145.     
  1146.   Return Codes:
  1147.   
  1148.     BST_NO_ERROR
  1149. */
  1150.  
  1151. typedef BOOL (_export FAR PASCAL * FP_DELETE_LIST_ITEM_CB) ( HWND,
  1152.                                                              LP_TREE_NODE);
  1153. short _export FAR PASCAL BSL_SetDeleteListItemCallBack (
  1154.                                        HWND hwndList, 
  1155.                                        FP_DELETE_LIST_ITEM_CB fpDeleteItemCB);
  1156.  
  1157.  
  1158. /*---------------------------------------------------------------------------
  1159.   short _export FAR PASCAL BSL_SetFont ( HWND hwndList, HFONT hFont);
  1160.  
  1161.   Description:
  1162.   
  1163.     Apply a given font to the drawing of the text for all the list items of
  1164.     the given list control.
  1165.   
  1166.   Arguments:
  1167.  
  1168.     HWND hwndList:
  1169.      
  1170.       This argument specifies the list control that will apply the given
  1171.       font to the text of every list item.
  1172.       
  1173.     HFONT hFont:
  1174.   
  1175.       hFont is a handle to a font that was created by the application.
  1176.  
  1177.   Comments:
  1178.   
  1179.     Once the list control receives the font handle, it becomes the property
  1180.     of the list control and it is the responsibility of the list control to
  1181.     delete the font.  The font will be deleted if a new font is sent to the
  1182.     list control by the application or if the list control receives a
  1183.     WM_DESTROY message.  The system font is the default font.
  1184.        
  1185.   Return Codes:
  1186.   
  1187.     BST_NO_ERROR
  1188. */
  1189. short _export FAR PASCAL BSL_SetFont ( HWND hwndList, HFONT hFont);
  1190.  
  1191.  
  1192.  
  1193. /*---------------------------------------------------------------------------
  1194.    short _export FAR PASCAL BSL_SetIcon ( HWND  hwndList,
  1195.                                           short nIcon,
  1196.                                           WORD wIndex,
  1197.                                           HICON hIcon);                    
  1198.   Description:
  1199.   
  1200.     Assigns an icon handle to a specified list item for the specified
  1201.     bitmap space.  Erases, but not deletes, the old icon or bitmap and draws
  1202.     the given icon.
  1203.   
  1204.   Arguments:
  1205.  
  1206.     HWND hwndList:
  1207.      
  1208.       hwndList is the list control in which the list item will receive the
  1209.       icon handle.
  1210.  
  1211.     short nIcon:
  1212.   
  1213.       nIcon is the index into the bitmap array of the list item in which the
  1214.       new handle will replace the old handle if the old handle exists.  
  1215.       This index is zero based and  the maximum index is MAX_BITMAPS - 1;
  1216.  
  1217.     WORD wIndex:
  1218.  
  1219.       Specifies the zero based index of the list item which will be 
  1220.       assigned the new bitmap handle specified by the argument hBitmap.
  1221.     
  1222.     HICON hIcon:
  1223.      
  1224.       hIcon is the handle to the icon which will be drawn in the specified
  1225.       bitmap space for the given list item, indexed by wIndex.  It will be
  1226.       stored in the list item's hBitmap[] array in the member indexed by
  1227.       nIcon.
  1228.     
  1229.       Bitmap spaces are the regions before the list item text where the
  1230.       bitmaps/icons are painted.  The left most bitmap space corresponds
  1231.       with the first array member of the list item's hBitmap[] array.
  1232.       The second left most bitmap space corresponds with the second array
  1233.       member of the list item's hBitmap[] array, and so on.
  1234.       The hBitmap[] array stores the list item's bitmap/icon handles but the
  1235.       bitmap spaces are defined globally for all list items.  This keeps
  1236.       column alignment which looks good and makes hit testing tolerable.
  1237.     
  1238.       Reference the list control exported API, BSL_SetBitmapSapce ( ) to
  1239.       learn the process of defining a bitmap space.
  1240.      
  1241.   Comments:
  1242.   
  1243.     Bitmap/icon handles are NOT the property of the list control.  The list
  1244.     control treats the bitmap/icon handle as read only.  It will use the
  1245.     handle to draw the bitmap/icon associated with the list item.  If the
  1246.     list item already has a bitmap/icon handle stored in the specified bitmap
  1247.     position then the old handle is simply overwritten.  It is the
  1248.     responsibility of the application to manage creation and destruction of
  1249.     bitmaps/icons.  If the application deletes/destroys bitmaps/icons before
  1250.     the list item are destroyed, then the list control will possibly
  1251.     reference invalid bitmap/icon handles.
  1252.      
  1253.     For more information regarding bitmaps/icons and list items, refer to the
  1254.     TREE_NODE structure documentation in the header BSCORE.H.
  1255.   
  1256.   Return Codes:
  1257.   
  1258.     BST_NO_ERROR
  1259. */
  1260.                                                                                       
  1261. short _export FAR PASCAL BSL_SetIcon ( HWND  hwndList,
  1262.                                        short nIcon,
  1263.                                        WORD wIndex,
  1264.                                        HICON hIcon);
  1265.  
  1266.  
  1267. /*---------------------------------------------------------------------------
  1268.   short _export FAR PASCAL BST_SetXSpaceBeforeText( HWND  hwndList,
  1269.                                                     short nWidth);
  1270.                             
  1271.   Description:
  1272.      
  1273.     Allows the application to adjust the space between the last bitmap
  1274.     (if any) and the first character of the text string.
  1275.   
  1276.   Arguments:
  1277.  
  1278.     HWND hwndList:
  1279.      
  1280.       This argument specifies the list control in which to reserve space
  1281.       before the first character of the list items's text string.
  1282.  
  1283.     short nWidth:
  1284.   
  1285.       nWidth is the width of the reserved space before the text.  This is
  1286.       expressed in pixels.
  1287.       
  1288.   Comments:
  1289.  
  1290.     There is no default space between the rightmost bitmap space and the
  1291.     first character of the text.
  1292.    
  1293.   Return Codes:
  1294.   
  1295.     BST_NO_ERROR
  1296. */
  1297.  
  1298.  
  1299. short _export FAR PASCAL BSL_SetXSpaceBeforeText ( HWND  hwndList,
  1300.                                                    short nWidth);
  1301. /*----------------------------------EOF-------------------------------------*/
  1302.