Hi all
I have a "small" problem with the printer server monitoring (so not a
single printer, a server with a lot of printers). Monitoring type is
PRINTER_NOTIFY_TYPE (I want to see the printer settings changes only,
no JOB or other )
Openprinter( server .... (so I monitor the server itself, not the
printers one-by-one)
FindFirstPrinterChangeNotification ...
FindNextPrinterChangeNotification ...
....
Everything works fine, no error.
I become all the waited PRINTER_NOTIFY_FIELD_DEVMODE and ATTRIBUTES
messages, perfect,
BUT there is the problem: I do not know exactly from witch
printer ?!?
I can not find any info in the PRINTER_NOTIFY_INFO structure about the
printer self, who's settings changed.
I tried the dmDeviceName from the DEVMODE, but it is only 31 char
long, and if I have more than one printer name that starts the same,
witch is it? So not near perfect.
The PRINTER_NOTIFY_FIELD_PRINTER_NAME does not come, because it did
not change.
If I set the PRINTER_NOTIFY_OPTIONS_REFRESH in the
FindNextPrinterChangeNotification (to have all the info, not only what
changed), then it puts out ALL the parameters from ALL the printers
(not only from the one had the change) ... again not usable
There is a PRINTER_NOTIFY_INFO_DATA field: ID. After some testing it
seems to be some printer ID, but msdn says: "Indicates the job
identifier if the Type member specifies JOB_NOTIFY_TYPE. If the Type
member specifies PRINTER_NOTIFY_TYPE, this member is undefined.".
http://msdn2.microsoft.com/en-us/library/ms535635(VS.85).aspx
I use PRINTER_NOTIFY_TYPE, so i do not think I can safely use it.
So the problem is simple: in a Printer server monitoring situation
witch way can I read out the name/handle/anyID of the printer, that
settings changed ?
Thanks
MrZed
Archived from group: microsoft>public>vb>winapi