Property Page Enumeration Function

When the Device Manager calls EnumPropPages, it passes three arguments: the address of a DEVICE_INFO structure, the address of a AddPropSheetPageProc function, and a 32-bit value. The DEVICE_INFO structure identifies the device or class that the user has requested properties for. The 32-bit value is used by the Device Manager to keep track of internal processing and must not be changed.

You use the AddPropSheetPageProc function to add property pages to the default property sheet. The function requires two parameters: a handle of a valid property sheet page and the supplied 32-bit value. You create a valid property sheet page and retrieve its handle by using the CreatePropertySheetPage function. The AddPropSheetPageProc function returns TRUE if it added the page, FALSE otherwise.

To replace one or both default property pages, you add the replacement pages using AddPropSheetPageProc, then set one or both of these values in the Flags member of the DEVICE_INFO structure:

DI_GENERALPAGE_ADDED Replaces the default general property page.
DI_RESOURCEPAGE_ADDED Replaces the default resources property page.

If you replace a default page, your replacement page must provide all the basic functions provided by that default page. If you do not replace a default page, the Device Manager uses the default page for the class or device as appropriate.

The EnumPropPages function returns TRUE to direct the Device Manager to display the property sheet or FALSE to prevent display.