You create a notebook by using the WC_NOTEBOOK window class name in the ClassName parameter of WinCreateWindow. The following sample code shows the creation of the notebook. The style set in the ulNotebookStyles variable (the BKS_* values) specifies that the notebook is to be created with a solid binding and the back pages intersecting at the bottom-right corner, major tabs placed on the right edge, shape tab square, tab text centered, and status-line text left-justified These are the default settings and are given here only to show how notebook styles are set.

HWND    hwndNotebook;            /* Notebook window handle            */
ULONG   ulNotebookStyles;        /* Notebook window styles            */
ULONG   x, y, cx, cy;            /* Coordinates                       */

/**********************************************************************/
/* Set the BKS_style flags to customize the notebook.                 */
/**********************************************************************/
ulNotebookStyles =
  BKS_SOLIDBIND     |          /* Use solid binding                   */
  BKS_BACKPAGESBR   |          /* Set back pages to intersect at the  */
                               /* bottom-right corner                 */
  BKS_MAJORTABRIGHT |          /* Position major tabs on right side   */
  BKS_SQUARETABS    |          /* Make tabs square                    */
  BKS_TABTEXTCENTER |          /* Center tab text                     */
  BKS_STATUSTEXTLEFT;          /* Left-justified status-line text     */

/**********************************************************************/
/* Create the notebook control window.                                */
/**********************************************************************/
hwndNotebook =
  WinCreateWindow(
    hwndParent,                /* Parent window handle                */
    WC_NOTEBOOK,               /* Notebook window class               */
    NULL,                      /* No window text                      */
    ulNotebookStyles,          /* Notebook window styles              */
    x, y, cx, cy,              /* Origin and size                     */
    hwndOwner,                 /* Owner window handle                 */
    HWND_TOP,                  /* Sibling window handle               */
    ID_BOOK,                   /* Notebook window ID                  */
    NULL,                      /* No control data                     */
    NULL);                     /* No presentation parameters          */

/**********************************************************************/
/* Make the notebook control visible.                                 */
/**********************************************************************/
WinShowWindow(
  hwndNotebook,                /* Notebook window handle              */
  TRUE);                       /* Make the window visible             */


[Back] [Next]