The BKM_DELETEPAGE message is used to delete one or more pages from the notebook. The application can delete one page (BKA_SINGLE attribute), all pages within a major or minor tab section (BKA_TAB attribute), or all of the pages in the notebook (BKA_ALL attribute). The default, if no attributes are specified, is to delete no pages. The following sample code shows how the BKM_QUERYPAGEID message is used to get the ID of the top page and how the BKM_DELETEPAGE message is then used to delete that page:

/**********************************************************************/
/* Set the range of pages to be deleted.                              */
/**********************************************************************/

/* Set attribute to delete a single page. */
usDeleteFlag = BKA_SINGLE

/**********************************************************************/
/* Get the ID of the notebook's top page.                             */
/**********************************************************************/
ulPageId = (ULONG) WinSendMsg(
  hwndNotebook,                /* Notebook window handle              */
  BKM_QUERYPAGEID,             /* Message to query a page ID          */
  NULL,                        /* NULL for page ID                    */
  (MPARAM)BKA_TOP);            /* Get ID of top page                  */

/**********************************************************************/
/* Delete the notebook's top page.                                    */
/**********************************************************************/
WinSendMsg(
  hwndNotebook,                /* Notebook window handle              */
  BKM_DELETEPAGE,              /* Message to delete the page          */
  MPFROMLONG(ulPageId),        /* ID of page to be deleted            */
  (MPARAM)usDeleteFlag);       /* Range of pages to be deleted        */


[Back] [Next]