do you know if there is a way to list printers with their present state : unplugged /disabled, or plugged/enabled? (I allready know how to list them)
Try to search for some Windows dll, which works with printers. If you'll find one, try to create wrapper for it in LabVIEW.
I didn't do exactly the same task, but I beleive that there is such a dll, what you can reuse.
Enclosed VI is a quick and dirty hack job to do de enumeration part of local printers. By changing the constants inside from 0x2 and 0xA to 0x10 and 0x18 respectively you can also get the remote printers (network and other remotely known printers).
Please note that the returned array of printers may actually contain top level printer containers that correspond to printer servers for instance and contain themselves a list of printers that has to be enumerated too.
This is indicated by the fact that the flags member in the record contains the flag 0x8000. In that case you would need to pass the name of that record to this function again and then get the actual resources this printer server contains.
LabVIEW also supports an Application Property "Printing:Available Printers" that will return you this information too.
Testing for the status of the printer is a different topic. I'll try to see if there is anything readily available in the Windows APIs and will post here if that is the case.
And here is the function to query the status. BUT!!!!
This returns the status of the print spooling queue, not the physical status of the printer. The queue only knows about any error condition in the printer after it tried to send at least one job to the printer. And suppose this job did end successfully by using the last paper (or toner) in the printer or before the printer went offline, you won't see the status of this before you actually attempt to send another job to the print queue.
And no, unless you know the exact printer protocol yourself there is no way to determine this through standard Windows means, as every printer uses different proprietary protocols to query all the status information directly rather then by trying to send it a job (if it even has such a functionality).
hello, and thanks for your help
i need have a look at the printer status (enabled-disabled) in order to display a dialogbox "beware, the selected printer is not active"
I'm open to any solution......