Re: 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?

There is a sample in the DDK which shows how to do what you want to do
(OEMDLL\OEMUI).

You should read through the sample and try to understand it. Maybe
build it and install it to see what it does. Then, try to port the code
and resources into your driver. Then, if you are having a problem, you
should ask about the problem.

Just to warn you, I don’t think there is any way to avoid CPSUI
(although you can use it to add your own pages/tabs which don’t have the
tree view).

ScottR

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of amitr0
Sent: Friday, September 22, 2006 5: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

dear scott,

There is a sample in the DDK which shows how to do what you want to do
(OEMDLL\OEMUI).

Yes, I know and I have been using it.

Then, if you are having a problem, you should ask about the problem
Wel, I am having problems adding my own custom dialog box into it!!! Hence
this question.

Just to warn you, I don’t think there is any way to avoid CPSUI

Ok, but then how do I do with CPSUI, some pointers would be useful!

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

I don’t mean to sound sarcastic, but “I am having problems” is not a
problem description which anyone can use to give you help. You must be
a great deal more specific. If you are having problems compiling code,
post the code and the error messages from the compiler. If the code
compiles but does not link, you post the linker error messages. If the
code compiles and links, but does not work, you must get error codes
from every API you call and handle them or fix the code so the error
code does not occur.

As for a pointer,

In DDK 3790.1830:
In file oemui.cpp, function hrOEMDevicePropertySheets, line 371 (and the
code around it) shows how to add a page with a static text box and a
button. Other DDKs have the same file and function but the line number
may be different.

Are you saying that you don’t know how to extend this to include a drop
down list and some checkboxes?

ScottR

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of amitr0
Sent: Friday, September 22, 2006 1:00 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] About Property sheets

dear scott,

There is a sample in the DDK which shows how to do what you
want to do (OEMDLL\OEMUI).

Yes, I know and I have been using it.

Then, if you are having a problem, you should ask about the
problem
Wel, I am having problems adding my own custom dialog box into
it!!! Hence this question.

Just to warn you, I don’t think there is any way to avoid CPSUI

Ok, but then how do I do with CPSUI, some pointers would be
useful!

— 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