PROPSHEETHEADER

 

Description

 

Defines the frame and pages of a property sheet.

 

C/C++ Syntax

 

typedef struct _PROPSHEETHEADER

{

DWORD dwSize;

DWORD dwFlags;

HWND  hwndParent;

HINSTANCE hInstance;

union {

HICON hIcon;

LPCTSTR pszIcon;

};

LPCTSTR pszCaption;

UINT nPages;

union {

UINT nStartPage;

LPCTSTR pStartPage;

};

union {

LPCPROPSHEETPAGE ppsp;

HPROPSHEETPAGE *phpage;

};

PFNPROPSHEETCALLBACK pfnCallback;

#if (_WIN32_IE >= 0x0400)

union {

HBITMAP hbmWatermark;

LPCTSTR pszbmWatermark;

};

HPALETTE hplWatermark;

union {

HBITMAP hbmHeader;

LPCSTR pszbmHeader;

};

#endif

} PROPSHEETHEADER, *LPPROPSHEETHEADER;

 

PB Syntax

 

UNION PROPSHEETHEADER_DUMMYUNIONNAME

hIcon   AS DWORD

pszIcon AS ASCIIZ PTR

END UNION

 

UNION PROPSHEETHEADER_DUMMYUNIONNAME2

nStartPage AS DWORD

pStartPage AS ASCIIZ PTR

END UNION

 

UNION PROPSHEETHEADER_DUMMYUNIONNAME3

ppsp   AS PROPSHEETPAGE PTR

phpage AS DWORD

END UNION

 

UNION PROPSHEETHEADER_DUMMYUNIONNAME4

hbmWatermark   AS DWORD

pszbmWatermark AS ASCIIZ PTR

END UNION

 

UNION PROPSHEETHEADER_DUMMYUNIONNAME5

hbmHeader   AS DWORD

pszbmHeader AS ASCIIZ PTR

END UNION

 

TYPE PROPSHEETHEADERA

dwSize       AS DWORD

dwFlags      AS DWORD

hwndParent   AS DWORD

hInstance    AS DWORD

PROPSHEETHEADER_DUMMYUNIONNAME

pszCaption   AS ASCIIZ PTR

nPages       AS DWORD

PROPSHEETHEADER_DUMMYUNIONNAME2

PROPSHEETHEADER_DUMMYUNIONNAME3

pfnCallback  AS DWORD

PROPSHEETHEADER_DUMMYUNIONNAME4

hplWatermark AS DWORD

PROPSHEETHEADER_DUMMYUNIONNAME5

END TYPE

 

Unicode version:

 

UNION PROPSHEETHEADERW_DUMMYUNIONNAME

hIcon   AS DWORD

pszIcon AS WORD PTR

END UNION

 

UNION PROPSHEETHEADERW_DUMMYUNIONNAME2

nStartPage AS DWORD

pStartPage AS WORD PTR

END UNION

 

UNION PROPSHEETHEADERW_DUMMYUNIONNAME3

ppsp   AS PROPSHEETPAGEW PTR

phpage AS DWORD

END UNION

 

UNION PROPSHEETHEADERW_DUMMYUNIONNAME4

hbmWatermark   AS DWORD

pszbmWatermark AS WORD PTR

END UNION

 

UNION PROPSHEETHEADERW_DUMMYUNIONNAME5

hbmHeader   AS DWORD

pszbmHeader AS WORD PTR

END UNION

 

TYPE PROPSHEETHEADERW

dwSize       AS DWORD

dwFlags      AS DWORD

hwndParent   AS DWORD

hInstance    AS DWORD

PROPSHEETHEADERW_DUMMYUNIONNAME

pszCaption   AS ASCIIZ PTR

nPages       AS DWORD

PROPSHEETHEADERW_DUMMYUNIONNAME2

PROPSHEETHEADERW_DUMMYUNIONNAME3

pfnCallback  AS DWORD

PROPSHEETHEADERW_DUMMYUNIONNAME4

hplWatermark AS DWORD

PROPSHEETHEADERW_DUMMYUNIONNAME5

END TYPE

 

Members

 

dwSize

 

Size, in bytes, of this structure. The property sheet manager uses this member to determine which version of the PROPSHEETHEADER structure you are using. For more information, see the Remarks.

 

dwFlags

 

Flags that indicate which options to use when creating the property sheet page. This member can be a combination of the following values.

 

PSH_DEFAULT

Uses the default meaning for all structure members. This flag is not supported in conjunction with PSH_AEROWIZARD.

PSH_AEROWIZARD

Version 7.0. Creates a wizard property sheet that uses the newer Aero style. The PSH_WIZARD flag must also be set.

PSH_HASHELP

Permits property sheet pages to display a Help button. You must also set the PSP_HASHELP flag in the page's PROPSHEETPAGE structure when the page is created. If any of the initial property sheet pages enable a Help button, PSH_HASHELP will be set automatically. If none of the initial pages enable a Help button, you must explicitly set PSH_HASHELP if you want to have Help buttons on any pages that might be added later. This flag is not supported in conjunction with PSH_AEROWIZARD.

PSH_HEADER

Version 5.80 and later. Indicates that a header bitmap will be used with a Wizard97 wizard. You must also set the PSH_WIZARD97 flag. The header bitmap is obtained from the pszbmHeader member, unless the PSH_USEHBMHEADER flag is also set. In that case, the header bitmap is obtained from the hbmHeader member. This flag is not supported in conjunction with PSH_AEROWIZARD.

PSH_MODELESS

Causes the PropertySheet function to create the property sheet as a modeless dialog box instead of as a modal dialog box. When this flag is set, PropertySheet returns immediately after the dialog box is created, and the return value from PropertySheet is the window handle to the property sheet dialog box. This flag is not supported in conjunction with PSH_AEROWIZARD.

PSH_NOAPPLYNOW

Removes the Apply button. This flag is not supported in conjunction with PSH_AEROWIZARD.

PSH_NOCONTEXTHELP

Version 5.80 and later. Removes the context-sensitive Help button ("?"), which is usually present on the caption bar of property sheets. This flag is not valid for wizards. This flag is not supported in conjunction with PSH_AEROWIZARD.

PSH_PROPSHEETPAGE

Uses the ppsp member and ignores the phpage member when creating the pages for the property sheet.

PSH_PROPTITLE

Displays a title in the title bar of the property sheet. The title takes the appropriate form for the Microsoft Windows version. In more recent versions of Windows, the title is the string specified by the pszCaption followed by the string "Properties". In older versions of Windows, the title is the string "Properties fo", followed by the string specified by the pszCaption member. This flag is not supported in conjunction with PSH_AEROWIZARD.

PSH_RESIZABLE

Allows the wizard to be resized by the user. Maximize and minimize buttons appear in the wizard's frame and the frame is sizable. To use this flag, you must also set PSH_AEROWIZARD.

PSH_RTLREADING

Reverses the direction in which pszCaption is displayed. Normal windows display all text, including pszCaption, left-to-right (LTR). For languages such as Hebrew or Arabic that read right-to-left (RTL), a window can be mirrored and all text will be displayed RTL. If PSP_RTLREADING is set, pszCaption will instead read RTL in a normal parent window and LTR in a mirrored parent window.

PSH_STRETCHWATERMARK

Stretches the watermark in Microsoft Internet Explorer 4.0-compatible Wizard97-style wizards. This flag is not supported in conjunction with PSH_AEROWIZARD.

Note  This style flag is only included to provide backward compatibility for certain applications. Its use is not recommended, and it is only supported by common controls versions 4.0 and 4.01. With common controls version 5.80 and later, this flag is ignored.

PSH_USECALLBACK

Calls the function specified by the pfnCallback member when initializing the property sheet defined by this structure.

PSH_USEHBMHEADER

Version 5.80 or later. Obtains the header bitmap from the hbmHeader member instead of the pszbmHeader member. You must also set either the PSH_AEROWIZARD flag or the PSH_WIZARD97 flag together with the PSH_HEADER flag.

PSH_USEHBMWATERMARK

Version 5.80 or later. Obtains the watermark bitmap from the hbmWatermark member instead of the pszbmWatermark member. You must also set PSH_WIZARD97 and PSH_WATERMARK. This flag is not supported in conjunction with PSH_AEROWIZARD.

PSH_USEHICON

Uses hIcon as the small icon in the title bar of the property sheet dialog box.

PSH_USEHPLWATERMARK

Version 5.80 or later. Uses the HPALETTE structure pointed to by the hplWatermark member instead of the default palette to draw the watermark bitmap and/or header bitmap for a Wizard97 wizard. You must also set PSH_WIZARD97, and PSH_WATERMARK or PSH_HEADER. This flag is not supported in conjunction with PSH_AEROWIZARD.

PSH_USEICONID

Uses pszIcon as the name of the icon resource to load and use as the small icon in the title bar of the property sheet dialog box.

PSH_USEPAGELANG

Version 5.80 or later. Specifies that the language for the property sheet will be taken from the first page's resource. That page must be specified by resource identifier.

PSH_USEPSTARTPAGE

Uses the pStartPage member instead of the nStartPage member when displaying the initial page of the property sheet.

PSH_WATERMARK

Version 5.80 or later. Specifies that a watermark bitmap will be used with a Wizard97 wizard. You must also set the PSH_WIZARD97 flag. The watermark bitmap is obtained from the pszbmWatermark member, unless PSH_USEHBMWATERMARK is set. In that case, the header bitmap is obtained from the hbmWatermark member. This flag is not supported in conjunction with PSH_AEROWIZARD.

PSH_WIZARD

Creates a wizard property sheet. When using PSH_AEROWIZARD, you must also set this flag.

PSH_WIZARD97

Version 5.80 or later. Creates a Wizard97-style property sheet that allows a header and/or watermark bitmap to be displayed in the background. This flag is not supported in conjunction with PSH_AEROWIZARD.

PSH_WIZARDCONTEXTHELP

Adds a context-sensitive Help button ("?"), which is usually absent from the caption bar of a wizard. This flag is not valid for regular property sheets. This flag is not supported in conjunction with PSH_AEROWIZARD.

PSH_WIZARDHASFINISH

Always displays the Finish button on the wizard. You must also set either PSH_WIZARD, PSH_WIZARD97, or PSH_AEROWIZARD.

PSH_WIZARD_LITE

Version 5.80 or later. Uses the Wizard-lite style. This style is similar in appearance to PSH_WIZARD97, but it is implemented much like PSH_WIZARD. There are few restrictions on how the pages are formatted. For instance, there are no enforced borders, and the PSH_WIZARD_LITE style does not paint the watermark and header bitmaps for you the way Wizard97 does. This flag is not supported in conjunction with PSH_AEROWIZARD.

 

hwndParent

 

Handle to the property sheet's owner window.

 

hInstance

 

Handle to the instance from which to load the icon or title string resource. If the pszIcon or pszCaption member identifies a resource to load, this member must be specified.

 

hIcon

 

Handle to the icon to use as the small icon in the title bar of the property sheet dialog box. If the dwFlags member does not include PSH_USEHICON, this member is ignored. This member is declared as a union with pszIcon.

 

pszIcon

 

Icon resource to use as the small icon in the title bar of the property sheet dialog box. This member can specify either the identifier of the icon resource or the address of the string that specifies the name of the icon resource. If the dwFlags member does not include PSH_USEICONID, this member is ignored. This member is declared as a union with hIcon.

 

pszCaption

 

Title of the property sheet dialog box. This member can specify either the identifier of a string resource or the address of a string that specifies the title. If the dwFlags member includes PSH_PROPTITLE, the string "Properties for" is inserted at the beginning of the title. This field is ignored for wizards.

 

nPages

 

Number of elements in the phpage array.

 

nStartPage

 

Zero-based index of the initial page that appears when the property sheet dialog box is created. This member is declared as a union with pStartPage.

 

pStartPage

 

Name of the initial page that appears when the property sheet dialog box is created. This member can specify either the identifier of a string resource or the address of a string that specifies the name. This member is declared as a union with nStartPage.

 

ppsp

 

Pointer to an array of PROPSHEETPAGE structures that define the pages in the property sheet. If the dwFlags member does not include PSH_PROPSHEETPAGE, this member is ignored. Note that the PROPSHEETPAGE structure is variable in size. Applications that parse the array pointed to by ppsp must take the size of each page into account. This member is declared as a union with phpage.

 

phPage

 

Pointer to an array of handles to the property sheet pages. Each handle must have been created by a previous call to the CreatePropertySheetPage function. If the dwFlags member includes PSH_PROPSHEETPAGE, phpage is ignored and should be set to NULL. When the PropertySheet function returns, any HPROPSHEETPAGE handles in the phpage array will have been destroyed. This member is declared as a union with ppsp.

 

pfnCallback

 

Pointer to an application-defined callback function that is called when the property sheet is initialized. For more information about the callback function, see the description of the PropSheetProc function. If the dwFlags member does not include PSH_USECALLBACK, this member is ignored.

 

hbmWatermark

 

Version 5.80 or later. Handle to the watermark bitmap. If the dwFlags member does not include PSH_USEHBMWATERMARK, this member is ignored.

 

pszbmWatermark

 

Version 5.80 or later. Bitmap resource to use as the watermark. This member can specify either the identifier of the bitmap resource or the address of the string that specifies the name of the bitmap resource. If the dwFlags member includes PSH_USEHBMWATERMARK, this member is ignored.

 

hplWatermark

 

Version 5.80 or later. HPALETTE structure used for drawing the watermark bitmap and/or header bitmap. If the dwFlags member does not include PSH_USEHPLWATERMARK, this member is ignored.

 

hbmHeader

 

Version 5.80 or later. Handle to the header bitmap. If the dwFlags member does not include PSH_USEHBMHEADER, this member is ignored.

 

pszbmHeader

 

Version 5.80 or later. Bitmap resource to use as the header. This member can specify either the identifier of the bitmap resource or the address of the string that specifies the name of the bitmap resource. If the dwFlags member includes PSH_USEHBMHEADER, this member is ignored.

 

Remarks

 

If the user chooses a setting such as Large Fonts, which enlarges the dialog box, the watermark that is painted on the start and finish pages will be enlarged as well. The size and position of the original bitmap will remain the same. The additional area will be filled with the color of the pixel in the upper-left corner of the bitmap.

 

Note that several members of this structure are only supported for Comctl32.dll versions 4.71 and later.

 

However, you must initialize the structure with its size. If you use the size of the currently defined structure, the application may not run with the earlier versions of Comctl32.dll, which expect a smaller structure. This includes all systems with Windows 95 or Microsoft Windows NT 4.0 that do not have Internet Explorer 4.0 or later installed. You can run your application on pre-4.71 versions of Comctl32.dll by defining the appropriate version number. However, this may cause problems if your application also needs to run on systems with more recent versions.

 

You can remain compatible with all Comctl32.dll versions by using the current header files and setting the size of the PROPSHEETHEADER structure appropriately. Before you initialize the structure, use the DllGetVersion function to determine which Comctl32.dll version is installed on the system. If it is version 4.71 or greater, use

 

psh.dwSize = SIZEOF(PROPSHEETHEADER)

 

to initialize the dwSize member. For earlier versions, the size of the pre-4.71 structure is given by the PROPSHEETHEADER_V1_SIZE constant. Use

 

psh.dwSize = %PROPSHEETHEADER_V1_SIZE

 

The four wizard styles, PSH_WIZARD, PSH_WIZARD97, PSH_WIZARD_LITE, and PSH_AEROWIZARD are mutually incompatible. Only one of these style flags should be set.

 

To convert an older wizard to the Aero-style wizard, replace the existing wizard flag (PSH_WIZARD, PSH_WIZARD97, or PSH_WIZARD_LITE) with the following.

 

%PSH_WIZARD OR %PSH_AEROWIZARD

 

After you rebuild the wizard, it will appear with the new style.

 

Minimum Operating System

 

Windows 95, Windows NT 3.1.

 

Valid XHTML 1.0 Transitional