PropSheet_RecalcPageSizes macro

Recalculates the page size of a standard or wizard property sheet after pages have been added or removed. You can use this macro or send the PSM_RECALCPAGESIZES message explicitly.


BOOL PropSheet_RecalcPageSizes(
   HWND hPropSheetDlg



Type: HWND

Handle to the property sheet's dialog box.

Return value

Returns TRUE if successful, or FALSE otherwise.


When a property sheet is created, it is sized to fit its initial collection of pages. To maintain compatibility with previous versions of the common controls, property sheets and wizards do not automatically resize themselves when pages are subsequently added or removed. With common controls version 5.80 and later, applications should use the PropSheet_RecalcPageSizes macro after adding or removing pages with PropSheet_AddPage, PropSheet_InsertPage, PropSheet_RemovePage, or their equivalent messages. It ensures that the property sheet is properly sized for its current collection of pages. If this macro or the equivalent message is not used, some property sheet pages may be truncated or too large.

Note  This macro is not supported when using the Aero wizard style (PSH_AEROWIZARD).


Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]