Board index » delphi » printer detection : is it possible ?

printer detection : is it possible ?

If you have two printers installed in Windows,
both with a very simple driver,
is it then possible to detect if one, two or both
are connected or online
through a Delphi procedure ?

I known : This might be a windows problem.

thx, SETKI

 

Re:printer detection : is it possible ?


Try something like:
.
.
ComboBox1.Items := Printer.Printers;
ComboBox1.ItemIndex := Printer.PrinterIndex;
.
hth

Quote
SETKI wrote in message <3577116c.1093...@NEWS.SKYNET.BE>...

>If you have two printers installed in Windows,
>both with a very simple driver,
>is it then possible to detect if one, two or both
>are connected or online
>through a Delphi procedure ?

>I known : This might be a windows problem.

>thx, SETKI

Re:printer detection : is it possible ?


Quote
>>If you have two printers installed in Windows,
>>both with a very simple driver,
>>is it then possible to detect if one, two or both
>>are connected or online
>>through a Delphi procedure ?
>Try something like:
>ComboBox1.Items := Printer.Printers;
>ComboBox1.ItemIndex := Printer.PrinterIndex;

this ain't the way...
because Delphi doesn't detect if a printer is ON or OFFLINE.
This way you only display the possible installed printers and
not the ones who are ready to print and really ONline.

eg. you have 5 printers installed in Windows but only one
can be connected with your PC.
How to detect the correct printer...?

THX, SETKI

Re:printer detection : is it possible ?


In article <357c4232.2472...@NEWS.SKYNET.BE>, serge.tk...@skynet.be (SETKI)
writes:

Quote
>eg. you have 5 printers installed in Windows but only one
>can be connected with your PC.
>How to detect the correct printer...?

In Win32 PRINTER_INFO_2 is a structure that includes PrinterStatus in its
returned data - including PRINTER_STATUS_OFFLINE. EnumPrinters calls for this
structure to be filled. Happy Hunting in Win32.Hlp <g>

Alan LLoyd
alangll...@aol.com

Re:printer detection : is it possible ?


On 10 Jun 1998 20:08:42 GMT, alangll...@aol.com (AlanGLLoyd) wrote:

Quote
>In article <357c4232.2472...@NEWS.SKYNET.BE>, serge.tk...@skynet.be (SETKI)
>writes:

>>eg. you have 5 printers installed in Windows but only one
>>can be connected with your PC.
>>How to detect the correct printer...?

>In Win32 PRINTER_INFO_2 is a structure that includes PrinterStatus in its
>returned data - including PRINTER_STATUS_OFFLINE. EnumPrinters calls for this
>structure to be filled. Happy Hunting in Win32.Hlp <g>

>Alan LLoyd
>alangll...@aol.com

Yes, this seems to work very well,
but when we used this piece of programming
for a network configuration,
it didn't work anymore....

Any clue ...?

thx, SETKI

Other Threads