Board index » cppbuilder » Get the printer status

Get the printer status

Hi all,

I want to determine the status of the actual printer to eventually
inform the user that printing is not possible.

I use a freeware component called TLinePrinter. To get the handle of the
printer used I have written a function that returns the TPrinter*
pointer. Then I have tried to get the handle:

HANDLE  hPrinter = LinePinter->GetMyPrinter()->Handle;

A call to GetPrinter() from the Win32 API always signals that an invalid
handle is used.

How can I find the status of the printer?

Thank you in advance.

Dr. Wieland Scholz
Freital, Germany

 

Re:Get the printer status


You can find an example of the GetPrinter API function at my web site:

http://www.cbdn.cjb.net/p004.htm

For more information, contact the borland.public.cppbuilder.winapi
newsgroup.

--
Yoto Yotov

C++Builder Developer's Network
http://cbdn.cjb.net/

Quote
"Wieland Scholz" <WielandSch...@gmx.de> wrote in message

news:3844F6D0.6867E079@gmx.de...
Quote
> Hi all,

> I want to determine the status of the actual printer to eventually
> inform the user that printing is not possible.

> I use a freeware component called TLinePrinter. To get the handle of the
> printer used I have written a function that returns the TPrinter*
> pointer. Then I have tried to get the handle:

> HANDLE hPrinter = LinePinter->GetMyPrinter()->Handle;

> A call to GetPrinter() from the Win32 API always signals that an invalid
> handle is used.

> How can I find the status of the printer?

> Thank you in advance.

> Dr. Wieland Scholz
> Freital, Germany

Re:Get the printer status


Yoto Yotov schrieb:

Quote

> You can find an example of the GetPrinter API function at my web site:

> http://www.cbdn.cjb.net/p004.htm

> For more information, contact the borland.public.cppbuilder.winapi
> newsgroup.

> --
> Yoto Yotov

> C++Builder Developer's Network
> http://cbdn.cjb.net/

I have tried this but the status value is always 0 independendly what
the printer actually does.
But I want to get the actual state of it.

Dr. Wieland Scholz
Freital, Germany

Re:Get the printer status


Quote
> I have tried this but the status value is always 0 independendly what
> the printer actually does.

For a more complete example on getting the printer status, please read:

Get the Status of a Printer and a Print Job
http://support.microsoft.com/support/kb/articles/q160/1/29.asp

--
Yoto Yotov

C++Builder Developer's Network
http://cbdn.cjb.net/

Other Threads