Hi all,
My printer driver UI is trying to send a command through
LanguageMonitor to the printer for getting the printer configuration.It
is working fine when the printer is connected to my serial/Parallel and
printer is on switch state.
But it gives delay,when the printer is in switch off state or not
connected to systems serial /parallel port. I need to detect this
(switch off state) before sending the command to the printer and
overcome the delay
How it can be done?
Regards
Hari
>>
Hi all,
My printer driver UI is trying to send a command through
LanguageMonitor to the printer for getting the printer configuration.It
is working fine when the printer is connected to my serial/Parallel and
printer is on switch state.
But it gives delay,when the printer is in switch off state or not
connected to systems serial /parallel port. I need to detect this
(switch off state) before sending the command to the printer and
overcome the delay
How it can be done?
Regards
Hari
<<
Easiest solution from the UI is probably to use Win32 GetPrinter API for level 6 information (See PRINTER_INFO_6, which is basically “DWORD of status bits, some of which appear to have redundant definitions”)- it’s probably enough to check for the PRINTER_STATUS_OFFLINE bit, although the whole printer space is quirky enough (IMO) you may need to play with it a bit to be sure.
Hi
Thanks for your reply. I checked with PRINTER_INFO_6,but it gives the
status of the printer in PRINTERS AND FAXES folder.(i.e) when we right
click the printer,there is a option to ,make printer offline.
I need to know whether printer is connecetd to the system
parallel/serial port
Easiest solution from the UI is probably to use Win32 GetPrinter API for
level 6 information (See PRINTER_INFO_6, which is basically “DWORD of
status bits, some of which appear to have redundant definitions”)- it’s
probably enough to check for the PRINTER_STATUS_OFFLINE bit, although
the whole printer space is quirky enough (IMO) you may need to play with
it a bit to be sure.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bob Kjelgaard
Sent: Friday, April 06, 2007 8:06 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] How to detect the printer is not connected to the
parallel/serial port
>
Hi all,
My printer driver UI is trying to send a command through
LanguageMonitor to the printer for getting the printer configuration.It
is working fine when the printer is connected to my serial/Parallel and
printer is on switch state.
But it gives delay,when the printer is in switch off state or not
connected to systems serial /parallel port. I need to detect this
(switch off state) before sending the command to the printer and
overcome the delay
How it can be done?
Regards
Hari
<<
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
Hari-
That’s sort of what I meant by “quirky”. One of the two “unavailable” bits might work for you, then.
Otherwise, I believe you are basically screwed- as I recall it, parallel class device objects are exclusive access, and the spooler already has it open. You’re limited to what’s provided in the spooler API.
I’ve seen a few attempts to get around that, and AFAIK, they all failed and generally fall into the category of “things so utterly dangerous and devoid of reason even I wouldn’t try them”.
But I’d be happy to be wrong 'bout that. Perhaps someone else has something better for you…
Hari-
Two additional thoughts from over the weekend that may help:
On the printer enumeration, you may not be seeing the wizard because the printer was enumerated previously and a decision to install no driver was made. This can easily happen if the printer was attached during OS install (and no inbox driver is available). You can check for entries under HKLM/System/CurrentControlSet/Enum/LptEnum. The Manufacturer name and model name keywords will be present for each device with an IEEE-1284 ID. You may find your printer already there, in this case. The first key name in the hierarchy for your printer under LptEnum is the hardware ID for your INF, BTW (one cheap way to get there). An instance number is the second. All of that subject to the inevitable haziness of information I’ve not not needed for years, of course…
On the status, you probably can’t see the status change until an I/O actually fails (and that decision involves a rather lengthy timeout period)- at least, that’s the way it used to work. You should be able to reduce the port I/O timeout to reduce the delays you are seeing (unfortunately this can cause false reports of a hang if the printer asserts BUSY for periods exceeding the timeout when processing input).
Don’t know why this didn’t occur to me earlier (what, me think?) but start here for your printer ID questions- pretty much this whole section should prove useful.
http://msdn2.microsoft.com/en-us/library/aa506006.aspx