DLGPAGE

typedef struct _DLGPAGE {

WORD cbSize;

WORD Flags;

DLGPROC DlgProc;

LPTSTR pTabName;

DWORD IconID;

union {

WORD DlgTemplateID;

HANDLE hDlgTemplate;

};

} DLGPAGE, *PDLGPAGE;

The DLGPAGE structure describes the non-treeview property sheet page characteristics.

Members

cbSize

Size in bytes of this structure.

Flags

Bitmask in which any combination of the following flags can be set.

Flag Description
DPF_ICONID_AS_HICON IconID is a handle to an icon rather than an icon resource ID.
DPF_USE_HDLGTEMPLATE The CPSUI should use the hDlgTemplate union member.

DlgProc

Pointer to a caller-defined DLGPROC procedure that subclasses the page's dialog box processing.

pTabName

Pointer to the null-terminated string to be displayed on the dialog box tab.

IconID

Specifies the icon to display on the dialog box tab. This member can be a standard IDI_CPSUI_Xxx icon ID, a caller-defined icon resource ID, or a handle to a caller-defined icon if DPF_ICONID_AS_HICON is set in the Flags field. A value of zero indicates that no icon should be displayed.

DlgTemplateID

Specifies the ID of the template to use for the property sheet page dialog box. The DP_STD_Xxx templates are 252x216 dialog box units in size. This field can be user-defined, or can have one of the following values.

Value Description
DP_STD_TREEVIEWPAGE This page is a standard treeview page provided by the CPSUI. The CPSUI treeview page displays all valid OPTITEMs as a tree, and allows the user to modify valid selectable OPTITEMs on the page.
DP_STD_DOCPROPPAGE This page is the standard Document Properties page provided by the CPSUI.

User-defined values must not conflict with system-supplied ones.

hDlgTemplate

Handle to the DLGTEMPLATE structure that describes the property sheet page dialog box. The CPSUI uses this handle to display the dialog box.

Comments

If DlgProc is not null and DlgTemplateID is not DP_STD_Xxx, the CPSUI processes messages as shown in the following table.

Message Description
WM_INITDIALOG The CPSUI initializes the dialog box and then calls the function to which DlgProc points with the WM_INITDIALOG message. The DlgProc function should return the behavior expected for this message; see the Win32 SDK for details.

The lParam member of WM_INITDIALOG is a pointer to a Win32 PROPSHEETPAGE structure. The lParam field of the PROPSHEETPAGE structure is the UserData field of the COMPROPSHEETUI structure.

To access the PSPINFO structure associated with this property sheet page, the caller's DlgProc function should use the CPSUI-defined PPSPINFO_FROM_WM_INITDIALOG_LPARAM(lParam) macro, where lParam is the parameter passed to the WM_INITDIALOG message. The caller's subclass function should save the pointer to the PSPINFO structure for later use. It must not modify the contents of the PSPINFO structure.

All Other Dialog Messages If the value returned by the DlgProc function is non-zero, the CPSUI assumes that the DlgProc function has processed the message entirely. If the value returned is zero, the CPSUI processes the message.

Each OPTITEM corresponds to one input control with one extended check box or extended push button. Because the CPSUI automatically disables and removes from the property sheet those items with the OPTIF_HIDE flag set, and dynamically moves the remaining controls, the following tips for designing the dialog box controls should be followed:

·Each item should have one input control with an optional extended check box or extended push button, one icon control, and other static controls.

·Each item should occupy the entire horizontal space of the property sheet page. Items should not overlay each other in the vertical direction.

·For items whose option type is TVOT_2STATES or TVOT_3STATES, if the option buttons are arranged from left to right in state order, the option buttons and icons should be aligned on the X axis. If the option buttons are arranged from top to bottom in state order, the option buttons and icons should be aligned on the Y axis.

·If option buttons and icons are arranged top to bottom in order and there are other controls obscured in Y direction, the CPSUI rearranges the option buttons but does not remove any white space in the Y direction.

·If multiple items share one group box, the group box must belong to the first OPTITEM, which is the topmost item in the group box. The caller must design the group box to be large enough to contain all items associated with it.