I haven’t touched this stuff in several years- much of it predates UniDrv. This is admittedly high-level and sketchy…
I know of two methods:
(1) You initialize CPSUI’s callback mechanism with some empty arrays for the pages and controls it should display, and an array of your add-on pages. I saw this used about 5-6 years ago. This provides some of the single point UI callbacks [so you grab all your data out of the UI in one routine], but there was at least one undesirable side effect. I think it was that if the user didn’t touch a control on the first page, changed controls on the others, and said OK, the proper callbacks didn’t come and thus the settings were incorrect. As I understood it MS had confirmed it was a problem, but there was no sense at the customer end that it was going to be fixed [no, I wasn’t anywhere near this place at the time].
(2) I worked this method out for myself even earlier (NT4 timeframe)- you ignore (never initialize) the callback mechanism and just use the functions for dynamically adding pages (either HPROPSHEETPAGE or PROPSHEETPAGE) at init time. You write the property page code the same way you would for a user mode app- the settings on an OK or apply are distributed across the pages, since each gets the message in turn. I did need to use a CPSUI request to propagate the final OK/Cancel result from my pages up to the caller (I think it was CPSUIFUNC_SETRESULT or something like that- at that time it was listed in the headers, but not in the DDK)- without that, the spooler would not persist preferences, but otherwise, it seemed to work pretty well, and was about as straightforward an approach as I could find.
But I have heard (too vaguely to be certain) that this second method also has some problems. I never got a chance to reproduce or investigate them, so I can’t tell you for certain if this is hackery that happened to work, or is a usable approach. I don’t even recall their nature, other than that I was surprised I hadn’t seen them when I first tested the approach [but that does occasionally happen].
I’m doubtful either method can be reasonably used with a minidriver. There have to be some dependencies voided by either approach.
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of amitr0
Sent: Friday, September 22, 2006 2:01 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] About Property sheets
I want to extend the printer property sheets. CPSUI looks complicated, and also has custom built pages. My requiremets are simple,
when i press PREFERENCES the third tab would be a property page that lets me display a simple drop down combo box and some check boxes.
The fancy tree view and otehr stuff is not needed.
How do I go about doing it?
— Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer