home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 20.ddi / DOC.PAK / BWCCAPI.TXT < prev    next >
Encoding:
Text File  |  1993-12-02  |  28.2 KB  |  777 lines

  1.                            BWCCAPI.TXT
  2.                            ===========
  3.  
  4.  
  5. This file describes technical aspects of the Borland Windows
  6. Custom Controls (BWCC) and contains information that might
  7. be useful or of interest to the advanced resource designer.
  8.  
  9. BWCC FUNCTIONS
  10. ============================================================
  11. BWCC.DLL exports these additional functions.
  12.  
  13. BWCCRegister(HINSTANCE hInst)
  14. -----------------------------
  15. This function is used to register an instance of the
  16. application with BWCC.dll.  It is required for 32-bit
  17. applications and should be called when the application
  18. is initialized.
  19.  
  20. BWCCIntlInit (UINT language)
  21. ----------------------------
  22. This function (call on startup) selects a language (see
  23. BWCC.H for language choices) for text and bitmaps (it
  24. returns TRUE for success or FALSE for failure). If you
  25. don't use this function. BWCC uses its default resource
  26. language, which depends on which translated version you have.
  27. Each BWCC client can use a different language.
  28.  
  29. BWCCIntlTerm (VOID)
  30. -------------------
  31. This function frees memory (use on exit) after you use
  32. BWCCIntlInit. This function returns TRUE (success) or FALSE
  33. (failure).
  34.  
  35. BWCCGetVersion
  36. --------------
  37. This function, which takes no parameters, returns the current
  38. version of BWCC.DLL. The value it returns is defined in
  39. BWCC.H as BWCCVERSION.
  40.  
  41. BWCCGetPattern
  42. --------------
  43. This function, which takes no parameters, returns a handle
  44. to the brush used to paint the background of BorDlg class
  45. dialogs. Since this brush could be a patterned brush, you
  46. must align it by calling UnrealizeObject and SetBrushOrg
  47. before selecting it into a device context. Do not delete
  48. this brush by calling DeleteObject!
  49.  
  50. BWCCMessageBox
  51. --------------
  52. This function, which is call-compatible with the Windows
  53. standard function MessageBox, displays a message box that
  54. is consistent with the Borland dialog box style.
  55.  
  56.  
  57. DEFINING A DERIVATIVE DIALOG CLASS
  58. ============================================================
  59. To create your own dialog window class (for example, if you
  60. want the dialog box to have its own icon), you must "derive"
  61. your class from the BORDLG class.
  62.  
  63. To derive a class from BORDLG, do the following:
  64.  
  65. 1. Your dialog window function should call BWCCDefDlgProc,
  66.     note the Windows standard DefDlgProc for messages that
  67.     it does not process.
  68.  
  69. 2. The window proc must call BWCCDefDlgProc for the
  70.     following messages:
  71.  
  72.           WM_CTLCOLOR        WM_NCCREATE
  73.           WM_NCDESTROY       WM_PAINT
  74.           WM_ERASEBKGND
  75.  
  76.  
  77. TECHNICAL DESCRIPTION OF BORLAND WINDOWS CUSTOM CONTROLS
  78. ============================================================
  79. This section contains descriptions of each of the Borland
  80. Windows Custom Controls classes. Most of the subsection
  81. headings are self-explanatory, with the possible exception of
  82. the following:
  83.  
  84. - "Class Name" gives the Resource Workshop name in quotation
  85.   marks, followed by the identifier name--C define or Pascal
  86.   constant.
  87.  
  88. - "Window styles" include "Types" and "Options." Within each
  89.   class there may be several "types" of controls. Types
  90.   dictate the overall appearance and functionality of the
  91.   control. Options are those available to each control type.
  92.  
  93. - "Messages" include "Commands" and "Notifications."
  94.   Commands are messages to a control. Notifications are a
  95.   special type of WM_COMMAND message used by controls. The
  96.   control ID of the control is passed in the wParam of the
  97.   message, while the lParam contains both the notification
  98.   type and the window handle of the control. The notification
  99.   type is contained in the high-order word of lParam and can
  100.   be extracted using the HIWORD macro; the window handle is
  101.   contained in the low-order word of lParam and can be
  102.   extracted using the LOWORD macro.
  103.  
  104.  
  105. BORBTN control
  106. ------------------------------------------------------------
  107. Function:     bitmapped push buttons and "splash panels"
  108.  
  109. Class Name:   "borbtn" ( BUTTON_CLASS )
  110.  
  111. Types inherited from standard Windows controls:
  112.    BS_DEFPUSHBUTTON and BS_PUSHBUTTON
  113.    Defines the two standard Windows push button types:
  114.         - BS_DEFPUSHBUTTON
  115.         - BS_PUSHBUTTON
  116.  
  117.    The BS_DEFPUSHBUTTON type identifies the "default"
  118.    push button. When the user presses the Enter key in a
  119.    dialog box, the default button's ID is in the wParam of
  120.    the WM_COMMAND message sent to the button's parent window.
  121.    The Windows dialog manager sends a BN_CLICKED
  122.    notification from that button to the dialog window.
  123.  
  124.    There are two exceptions:
  125.       - If another button gains keyboard focus through a
  126.         Tab keystroke, that key temporarily becomes the
  127.         default button and is referenced in the BN_CLICKED
  128.         notification.
  129.       - If keyboard focus is in an edit control for which the
  130.         ES_WANTRETURN flag is set, the Enter key inserts a
  131.         carriage return into the text in the edit control.
  132.  
  133. Types unique to BWCC:
  134.    BBS_BITMAP
  135.  
  136.    This type is used to display "splash panels," which
  137.    are bitmaps the user does not interact with.
  138.  
  139. Options unique to BWCC:
  140.    BBS_PARENTNOTIFY
  141.    This option causes the control to generate the following
  142.    notification messages at run time (these are described
  143.    later in this file):
  144.         - BBN_SETFOCUS
  145.         - BBN_SETFOCUSMOUSE
  146.         - BBN_GOTATAB
  147.         - BBN_GOTABTAB
  148.  
  149.    BBS_OWNERDRAW
  150.    This option causes the control to send WM_DRAWITEM to
  151.    its parent at run time, for specialized drawing.
  152.  
  153. Commands inherited from standard Windows controls:
  154.    BM_SETSTYLE
  155.    The Windows dialog manager uses this message to toggle
  156.    between the BS_DEFPUSHBUTTON and BS_PUSHBUTTON types.
  157.  
  158.    BM_SETSTATE
  159.    This message changes the "highlight" state of a button.
  160.    If the wParam of the message is nonzero, the button is
  161.    highlighted (drawn as if it were pressed).
  162.  
  163.    BM_GETSTATE
  164.    This message determines whether a button is highlighted,
  165.    has focus, and whether it is "checked" (checking does not,
  166.    however, apply to buttons). The 0x0004 bit of the return
  167.    value indicates that the button is highlighted (drawn
  168.    with a heavy outline around the button); the 0x0008 bit
  169.    indicates that the button has the focus (a dotted line
  170.    surrounds the text caption).
  171.  
  172. Commands unique to BWCC
  173.    BBM_SETBITS
  174.    The application uses this message to pass a set of bitmap
  175.    handles to the button. Normally, the buttons use the
  176.    button control ID to automatically load bitmaps from the
  177.    user's resources. If the bitmaps do not exist, the button
  178.    caption is drawn into a default bitmap by using a
  179.    lighter-weight version of the dialog font. To use this
  180.    message, you must first create three bitmap images of a
  181.    single button:
  182.  
  183.         - the button without keyboard focus
  184.         - the button with keyboard focus, but not pressed
  185.         - the button when it is "pressed" (or highlighted)
  186.  
  187.    After creating the bitmaps, you must put the handles to
  188.    these bitmaps into an array and pass a far pointer to
  189.    this array in the lParam of the BM_SETBITS message.
  190.  
  191.    The following C and Pascal samples show how this is done:
  192.  
  193.    C SAMPLE
  194.    --------
  195.  
  196.       HBITMAP hBits[3];
  197.       HWND  hWndButton = GetDlgItem( hWnd, ID_FOO);
  198.  
  199.       hBits[0] = MakeNormalBitmap(...);
  200.       hBits[1] = MakeHighlightBitmap(...);
  201.       hBits[2] = MakeFocusBitmap(...);
  202.  
  203.       SendMessage( hWndButton, BBM_SETBITS, 0, (LONG) (LPSTR)
  204.            hBits);
  205.  
  206.    PASCAL SAMPLE
  207.    -------------
  208.  
  209.       procedure SetBitmaps(Wnd: HWnd);
  210.       var
  211.        Bits: array[0..2] of HBitmap;
  212.        WndButton: HWnd;
  213.       begin
  214.        WndButton := GetDlgItem(Wnd, id_Foo);
  215.        Bits[0] := MakeNormalBitmap(...);
  216.        Bits[1] := MakeHighlightBitmap(...);
  217.        Bits[2] := MakeFocusBitmap(...);
  218.        SendMessage(WndButton, BBM_SETBITS, 0, @@Bits);
  219.       end;
  220.  
  221.    NOTE: If a button's bitmaps are initialized in this manner,
  222.    the application must destroy the bitmaps by calling
  223.    DeleteObject before it terminates. The application
  224.    typically makes this call in the WM_DESTROY message
  225.    handler for the button's parent window.
  226.  
  227. Notifications inherited from standard Windows controls
  228.    BN_CLICKED
  229.    The button sends this message when it has been "pressed"
  230.    by the user, either by clicking while the mouse pointer
  231.    is within the button window or by either of the following
  232.    keyboard actions:
  233.  
  234.          - The user presses the Spacebar or the Enter key
  235.            when the button has keyboard focus.
  236.          - The user presses the button's accelerator key
  237.            when keyboard focus is in another control.
  238.  
  239.    To associate an accelerator key with a button, place an
  240.    ampersand before the ASCII value of the key in the
  241.    button's text (for example, "&Yes"). Note that case
  242.    is not significant for button accelerators.
  243.  
  244.    BN_DOUBLECLICKED
  245.    The button sends this message when it has been double-
  246.    clicked by the user. The notification is sent at the
  247.    time of the second mouse button-down message.
  248.  
  249. Notifications unique to BWCC
  250. The following notifications are available if you've specified the
  251. BBS_PARENTNOTIFY style.
  252.    BBN_SETFOCUS
  253.    The button sends this notification to its parent window
  254.    when it gains keyboard focus through an action other
  255.    than a mouse click.
  256.  
  257.    BBN_SETFOCUSMOUSE
  258.    The button sends this notification to its parent window
  259.    when it gains keyboard focus through a mouse click.
  260.  
  261.    BBN_GOTATAB
  262.    The button sends this notification to its parent window
  263.    when the user presses the <Tab> key while keyboard focus
  264.    is in the button. The parent can then intervene in the
  265.    processing of the keystroke by returning a nonzero value.
  266.  
  267.    BBN_GOTABTAB
  268.    The button sends this notification to its parent window
  269.    when the user presses Shift-Tab (back-tab) while keyboard
  270.    focus is in the button. The parent can then intervene in
  271.    the processing of the keystroke by returning a nonzero value.
  272.  
  273.    WM_DRAWITEM
  274.    If you specify the BBS_OWNERDRAW style for the button, it
  275.    sends a WM_DRAWITEM message to its parent window. The
  276.    lParam of the message contains a far pointer to a
  277.    DRAWITEMSTRUCT structure. The fields of that structure
  278.    are described in the Windows SDK documentation for this
  279.    message, but with the following enhancement:
  280.  
  281.    For Windows owner-draw buttons, the itemID field of the
  282.    DRAWITEMSTRUCT structure is unused. Borland buttons use
  283.    this field to pass their type. If the button is a default
  284.    push button, this field contains the value
  285.    BS_DEFPUSHBUTTON. Otherwise, it contains the value
  286.    BS_PUSHBUTTON.
  287.  
  288.    The other fields and the values passed in them are
  289.       CtlType      ODT_BUTTON
  290.  
  291.       CtlID        The control ID of the button
  292.                    (GetWindowWord(hWnd, GWW_ID))
  293.  
  294.       itemAction   ODA_DRAWENTIRE, unless the repaint
  295.                    is being caused by a focus change,
  296.                    in which case this field contains
  297.                    ODA_FOCUS
  298.  
  299.       itemState    The combination of the following
  300.                    values, depending on the current
  301.                    state of the button:
  302.                    ODS_FOCUS if the button has keyboard focus
  303.                    ODS_DISABLED if the button is disabled
  304.                    ODS_SELECTED if the button is highlighted
  305.  
  306.       hwndItem     The window handle of the control
  307.  
  308.       hDC          A device context for the window, with all
  309.                    values in the default state returned by GetDC
  310.  
  311.       rcItem       The client rectangle of the control
  312.  
  313. Button resource Id numbering scheme
  314. The Microsoft resource compiler does not provide user-
  315. specified control initialization data when it parses the
  316. Windows dialog template data structure. Because of this,
  317. Resource Workshop uses the control ID field as a base from
  318. which to derive the resource IDs of the bitmaps required by
  319. a button. For each bitmap button, there are six images:
  320. three for EGA and monochrome devices, and three for VGA
  321. and higher-resolution devices.
  322.  
  323. The bitmap resource IDs are derived from the button control
  324. using the following formulas:
  325.  
  326.    Control ID + 1000: Normal VGA-resolution image
  327.    Control ID + 3000: Pressed VGA-resolution image
  328.    Control ID + 5000: Focused VGA-resolution image
  329.  
  330.    Control ID + 2000: Normal EGA-resolution image
  331.    Control ID + 4000: Pressed EGA-resolution image
  332.    Control ID + 6000: Focused EGA-resolution image
  333.  
  334.  
  335. BORRADIO control
  336. ------------------------------------------------------------
  337. Function: Better-looking radio buttons
  338.  
  339. Class Name: "borradio" ( RADIO_CLASS )
  340.  
  341. Types inherited from standard Windows controls
  342.    BS_RADIOBUTTON
  343.    A nonautomatic radio button. The button merely informs
  344.    the application program that it has been "checked"
  345.    (pressed) via the BN_CLICKED notification. The
  346.    application is responsible for calling the
  347.    CheckRadioButton function to change the button's state
  348.    and the state of the other buttons it is grouped with.
  349.  
  350.    BS_AUTORADIOBUTTON
  351.    An "automatic" radio button. When the user selects one of
  352.    these buttons, it is automatically marked (with a circle
  353.    or diamond), and the previously selected button within the
  354.    group is deselected, without the intervention of the
  355.    application program.
  356.  
  357. Options inherited from standard Windows controls
  358.    BS_LEFTTEXT
  359.    This option causes the text associated with the button to
  360.    be displayed to the left of the button, rather than to the
  361.    right of the button.
  362.  
  363. Options unique to BWCC
  364.    BBS_PARENTNOTIFY
  365.    This option causes the control to generate the following
  366.    notification messages at run time:
  367.        - BBN_SETFOCUS
  368.        - BBN_SETFOCUSMOUSE
  369.        - BBN_GOTATAB
  370.        - BBN_GOTABTAB
  371.  
  372.    BBS_OWNERDRAW
  373.    This option causes the control to send WM_DRAWITEM to
  374.    its parent at run time, for specialized drawing.
  375.  
  376. Commands inherited from standard Windows controls
  377.    BM_GETCHECK
  378.    This message causes the button to return its current
  379.    "check" state (the message names and descriptions all
  380.    use check box imagery). If it is checked (pressed),
  381.    it returns a nonzero value. Otherwise, it returns zero.
  382.  
  383.    BM_SETCHECK
  384.    This message changes the check state of a button. If the
  385.    wParam of the message is nonzero, the button is checked
  386.    (filled with a circle or a diamond).
  387.  
  388.    BM_GETSTATE
  389.    This message determines whether a button is highlighted,
  390.    has focus, and whether it is checked. The low-order two
  391.    bits (0x0003) of the return value contain the check
  392.    state:  0 indicates unchecked and 1 indicates checked.
  393.    The 0x0004 bit of the return value indicates that the
  394.    button is highlighted (drawn with a heavy outline around
  395.    the circle or diamond); the 0x0008 bit indicates that the
  396.    button has the focus (a dotted line surrounds the text
  397.    caption).
  398.  
  399.    BM_SETSTATE
  400.    This message changes the highlight state of a button. If
  401.    the wParam of the message is nonzero, the button is
  402.    highlighted.
  403.  
  404. Notifications inherited from standard Windows controls
  405.    BN_CLICKED described earlier in this file.
  406.    BN_DOUBLECLICKED described ealier in this file.
  407.  
  408. Notifications unique to BWCC
  409. The following notifications are sent to the parent window
  410. only if the programmer has specified the BBS_PARENTNOTIFY
  411. style.
  412.        - BBN_SETFOCUS
  413.        - BBN_SETFOCUSMOUSE
  414.        - BBN_GOTATAB
  415.        - BBN_GOTABTAB
  416.  
  417.    WM_DRAWITEM
  418.    The description of this notification is identical to the
  419.    one under BORBTN, with the following exception:
  420.    For automatic radio buttons, the itemID field of the
  421.    DRAWITEMSTRUCT structure contains the value
  422.    BS_AUTORADIOBUTTON. Otherwise, it contains the value
  423.    BS_RADIOBUTTON.
  424.  
  425.  
  426. BORCHECK control
  427. ------------------------------------------------------------
  428. Function: Better-looking check boxes
  429.  
  430. Class Name: "borcheck" ( CHECK_CLASS )
  431.  
  432. Types inherited from standard Windows controls
  433.    BS_CHECKBOX
  434.    A nonautomatic check box. Application program intervention
  435.    is required to change its visual state after it has been
  436.    "clicked."
  437.  
  438.    BS_AUTOCHECKBOX
  439.    A check box that automatically changes state when clicked.
  440.  
  441.    BS_3STATE
  442.    A nonautomatic check box that switches between three
  443.    states: checked, unchecked, and indeterminate.
  444.  
  445.    BS_AUTO3STATE
  446.    An automatic version of BS_3STATE.
  447.  
  448. Options inherited from standard Windows controls
  449.    BS_LEFTTEXT
  450.    This option causes the text associated with the button to
  451.    be displayed to the left of the button, rather than to the
  452.    right of the button.
  453.  
  454. Options unique to BWCC
  455.    BBS_PARENTNOTIFY
  456.    This option causes the control to generate the following
  457.    notification messages at run time:
  458.          - BBN_SETFOCUS
  459.          - BBN_SETFOCUSMOUSE
  460.          - BBN_GOTATAB
  461.          - BBN_GOTABTAB
  462.  
  463.    BBS_OWNERDRAW
  464.    This option causes the control to send WM_DRAWITEM to its
  465.    parent at run time, for specialized drawing.
  466.  
  467. Commands inherited from standard Windows controls
  468.    BM_GETCHECK
  469.    This message causes the control to return its current
  470.    "check" state. The return value is 0 if the control is
  471.    unchecked; 1 if checked; and 2 if indeterminate (applies
  472.    only for 3-state check boxes).
  473.  
  474.    BM_SETCHECK
  475.    This message changes the state of a check box. If the
  476.    wParam of the message is 0, the check box is drawn empty;
  477.    if 1, the check box is checked; and if 2, it is drawn
  478.    with with a pattern indicating the indeterminate state.
  479.  
  480.    BM_GETSTATE
  481.    This message determines whether a check box is
  482.    highlighted, has focus, and whether it is checked.
  483.    The low-order two bits (0x0003) of the return value
  484.    contain the check state:  0 indicates unchecked; 1
  485.    indicates checked; and 2 indicates the indeterminate
  486.    state for 3-state check boxes. The 0x0004 bit of the
  487.    return value indicates that the check box is highlighted
  488.    (drawn with a heavy outline); the 0x0008 bit indicates
  489.    that the button has the focus (a dotted line surrounds
  490.    the text caption).
  491.  
  492.    BM_SETSTATE
  493.    This message changes the highlight state of a check box.
  494.    If the wParam of the message is a nonzero value, the
  495.    check box is highlighted.
  496.  
  497. Notifications inherited from standard Windows controls
  498.    BN_CLICKED described in the BORBTN section.
  499.    BN_DOUBLECLICKED described in the BORBTN section.
  500.  
  501. Notifications unique to BWCC
  502. The following notifications are sent to the parent window only if
  503. the programmer has specified the BBS_PARENTNOTIFY style:
  504.        - BBN_SETFOCUS
  505.        - BBN_SETFOCUSMOUSE
  506.        - BBN_GOTATAB
  507.        - BBN_GOTABTAB
  508.  
  509. For a description of these notifications, see the BORBTN
  510. section in this file.
  511.  
  512.    WM_DRAWITEM
  513.    The description of this notification is identical to the
  514.    one in the BORBTN section with the following exception:
  515.    For automatic check boxes, the itemID field of the
  516.    DRAWITEMSTRUCT structure contains the value
  517.    BS_AUTOCHECKBOX or BS_AUTO3STATE. Otherwise, it contains
  518.    the value BS_CHECKBOX or BS_3STATE.
  519.  
  520.  
  521. BORSHADE control
  522. ------------------------------------------------------------
  523. Function: panels and dividers
  524.  
  525. Class Name: "borshade" ( SHADE_CLASS )
  526.  
  527. Types unique to BWCC
  528.    BSS_GROUP
  529.    This style draws a "chiseled" gray box with a recessed
  530.    appearance.
  531.  
  532.    BSS_RGROUP
  533.    This style draws a "chiseled" gray box with a raised
  534.    appearance.
  535.  
  536.    BSS_HDIP
  537.    This style draws a horizontal dividing line that can be
  538.    used to separate sections of a dialog box.
  539.  
  540.    BSS_VDIP
  541.    This style draws a vertical dividing line that can be
  542.    used to separate sections of a dialog box.
  543.  
  544.    BSS_HBUMP
  545.    This style draws a horizontal dividing line that can be
  546.    used to separate sections of a gray group shade (BSS_GROUP
  547.    or BSS_RGROUP).
  548.  
  549.    BSS_VBUMP
  550.    This style draws a vertical dividing line that can be
  551.    used to separate sections of a gray group shade (BSS_GROUP
  552.    or BSS_RGROUP).
  553.  
  554. Options unique to BWCC
  555.    BSS_CAPTION
  556.    This option applies only to the BSS_GROUP and BSS_RGROUP
  557.    types. It causes the caption of the group shade box (if
  558.    any) to be appear above the recessed (or raised) portion
  559.    of the box. The dimensions of the box include the caption
  560.    as well as the box.
  561.  
  562.    BSS_CTLCOLOR
  563.    This option applies only to the BSS_GROUP and BSS_RGROUP
  564.    types. It causes the control to send registered messages
  565.    to its parent prior to erasing. The parent can then provide
  566.    a different brush for painting the group box background,
  567.    and make other changes to the HDC as needed. To use this
  568.    mechanism, you must first register a special message using
  569.    the Windows RegisterWindowMessage() API. In the file
  570.    BWCC.H you will find the following definition:
  571.  
  572.       #define BWCC_CtlColor_Shade "BWCC_CtlColor_Shade"
  573.  
  574.    Include the following static declaration in your program
  575.    (the following examples are in C):
  576.  
  577.       WORD hCtlColor_Shade;
  578.  
  579.    Then, in your application initialization function,
  580.    register the message:
  581.  
  582.     hCtlColor_Shade=RegisterWindowMessage(BWCC_CtlColor_Shade);
  583.  
  584.    In your window procedure, dialog box window procedure, or
  585.    most commonly your dialog procedure, test for the message:
  586.  
  587.       if (msg == hCtlColor_Shade)
  588.       {
  589.       ...
  590.       }
  591.  
  592.    The parameters for the message are the same as for
  593.    WM_CTLCOLOR, and the message is handled in the same
  594.    manner. For example, the text foreground and background
  595.    colors and the background mode in the HDC may be modified,
  596.    in order to change the appearance of the caption. A
  597.    background brush may be also returned. (As with normal
  598.    WM_CTLCOLOR handling, be sure not to create a new brush
  599.    every time the message is processed.)
  600.  
  601.    In order to return a brush from a dialog procedure (as
  602.    opposed to from a dialog box window procedure or a window
  603.    procedure), you must place the value of the brush into
  604.    offset DWL_MSGRESULT in the window structure with 
  605.    SetWindowLong() and then return TRUE. Here is an example:
  606.  
  607.       if (msg == hCtlColor_Shade)
  608.       {
  609.          SetTextColor( (HDC) wParam, RGB(255,0,0) ); // red text
  610.          SetBkColor( (HDC) wParam, RGB(128,128,128) ); // gray
  611.          SetBkMode ( (HDC) wParam, OPAQUE);
  612.          SetWindowLong( hwndDlg, DWL_MSGRESULT,
  613.                         GetStockObject(WHITE_BRUSH) );
  614.          return TRUE;
  615.       }
  616.  
  617.    The Windows include files provide a macro that combines
  618.    the last two steps:  SetDlgMsgResult(hwnd, msg, result),
  619.    which you would use with hCtlColor_Shade as the second
  620.    parameter.
  621.  
  622.    BSS_NOPREFIX
  623.    This option applies only to the BSS_GROUP and BSS_RGROUP
  624.    types, and is the equivalent of the SS_NOPREFIX option
  625.    for static text: it causes any ampersands (&) within the
  626.    caption to be treated as normal characters, rather than
  627.    causing the next character to be underlined.
  628.  
  629.    BSS_LEFT, BSS_CENTER, BSS_RIGHT
  630.    These options apply only to the BSS_GROUP and BSS_RGROUP
  631.    types, and control the horizontal placement of the caption.
  632.  
  633. Commands unique to BWCC
  634.    RegisterWindowMessage(BWCC_CtlColor_Shade)
  635.  
  636.  
  637. BORSTATIC control
  638. ------------------------------------------------------------
  639. Function: static text with a gray background
  640.  
  641. Class Name: "borstatic" ( STATIC_CLASS )
  642.  
  643. Types inherited from standard Windows controls
  644.    SS_LEFT The text is left-justified in the control.
  645.  
  646.    SS_RIGHT The text is right-justified in the control.
  647.  
  648.    SS_CENTER The text is center-justified in the control.
  649.  
  650.    SS_SIMPLE
  651.    The text is left-justified in a single line within the
  652.    control and does not word wrap.
  653.  
  654.    SS_LEFTNOWORDWRAP
  655.    The text is left-justified within the control and doesn't
  656.    word wrap.
  657.  
  658. Options inherited from standard Windows controls
  659.    SS_NOPREFIX
  660.    Ampersands (&) within the text do not cause the following
  661.    character to be underlined.
  662.  
  663.  
  664. BORDLG dialog class
  665. ------------------------------------------------------------
  666. Function: "Turbo" fast dialog box drawing
  667.  
  668. Class Name: "bordlg" ( BORDLGCLASS )
  669.  
  670. This custom dialog window class implements the "turbo painting"
  671. of Borland custom controls by keeping its own private list of
  672. controls within a dialog box and painting those controls itself.
  673. It also automatically provides a patterned background on VGA and
  674. higher-resolution displays. If you want your dialogs to have the
  675. "Borland look," specify this dialog class in your dialog box
  676. template. (As an alternative to specifying "bordlg" as the
  677. class, you may also call BWCCDefDlgProc(), as discussed in
  678. section 1 of this file).
  679.  
  680. Types inherited from standard Windows controls:
  681.    All valid styles for a standard Windows dialog box.
  682.  
  683. Commands inherited from standard Windows controls
  684.    WM_CTLCOLOR
  685.    If the user has provided a dialog procedure, it is called
  686.    with the WM_CTLCOLOR message. If it returns a non-zero
  687.    value, then no further processing takes place, and that
  688.    value is returned. Otherwise, the processing depends on
  689.    which CTCOLOR value is specified. For list boxes, the
  690.    background is set to a gray brush. For static and button
  691.    controls, the background mode is set to transparent; the
  692.    text color to COLOR_WINDOWTEXT; for non-monochrome
  693.    monitors, the background color is set to COLOR_GRAYTEXT;
  694.    and a gray background brush is returned.
  695.  
  696.    For CTLCOLOR_DLG, the steel-gray dialog background brush
  697.    is returned, but it is first unrealized and the origin of
  698.    the HDC is reset to match the dialog box.
  699.  
  700.    For other CTLCOLOR values, DefWindowProc() is called and
  701.    its value returned.
  702.  
  703.    WM_NCCREATE
  704.    This message sets up a structure, which is attached as a
  705.    property to the dialog window. As Borland controls are
  706.    then created, they will register themselves with the
  707.    dialog window, and information about each control will
  708.    be added to this structure. This is the mechanism used
  709.    to provide turbo-painting.
  710.  
  711.    After attaching the structure, WM_NCCREATE calls
  712.    DefDlgProc() and returns its value.
  713.  
  714.    WM_ERASEBKGND
  715.    This message first sends a WM_CTLCOLOR message with
  716.    CTLCOLOR_DLG to the user's dialog procedure (if any)
  717.    to get a background brush for the dialog. If zero is
  718.    returned, the chiseled-steel brush is used. But before
  719.    painting the background, the control structure is
  720.    iterated and any Borland group shades and Borland static
  721.    text controls are painted with a gray background (for
  722.    speed). (Note, however, that the brush used for group
  723.    shades may be modified by an additional CTLCOLOR-like
  724.    message, as described in the BORSHADE section.)
  725.  
  726.    The background brush is realigned with the top left
  727.    corner of the dialog window and the dialog background
  728.    is painted with it, excluding any rectangles that were
  729.    painted for group shades and static text controls.
  730.    Finally, WM_ERASEBKGND returns TRUE, to indicate to
  731.    Windows that no further erasing is necessary.
  732.  
  733.    WM_PAINT
  734.    This message iterates through the control structure
  735.    described above and paints each of the Borland controls.
  736.    For each control that is painted, its window is
  737.    validated, so that it won't itself get WM_PAINT or
  738.    WM_ERASE messages.
  739.  
  740.    After all Borland controls are painted, a thin frame
  741.    is drawn around the dialog to provide a sense of depth,
  742.    and zero is returned.
  743.  
  744.    WM_DESTROY
  745.    This message simply frees the control list attached to
  746.    the dialog window and then calls DefDlgProc(), returning
  747.    its value.
  748.  
  749.  
  750. Using BWCC controls in nondialog windows
  751. ------------------------------------------------------------
  752. If you want your nondialog windows to look like the BorDlg
  753. windows (with the steel-gray background and light gray
  754. background for static controls), BWCC.DLL provides two
  755. functions that replace the Windows standard "Def" window
  756. functions and that should be called in place of them:
  757.  
  758.   - For MDI child windows, call BWCCDefMDIChildProc instead
  759.     of the Windows standard function DefMDIChildProc.
  760.  
  761.   - For all other windows, call BWCCDefWindowProc instead of
  762.     the Windows standard function DefWindowProc.
  763.  
  764. As described earlier for BWCCDefDlgProc, your window proc
  765. must call either BWCCDefMDIChildProc or BWCCDefWindowProc
  766. for the following messages:
  767.          - WM_CTLCOLOR
  768.          - WM_NCCREATE
  769.          - WM_NCDESTROY
  770.          - WM_PAINT
  771.          - WM_ERASEBKGND
  772.  
  773. Note: BWCC does not provide a replacement function for
  774. DefFrameProc.
  775.  
  776.            ========= END OF FILE BWCCAPI.RW =========
  777.