Board index » delphi » How do I check printer status?

How do I check printer status?

Hi

Does anyone know of a way of checking the current status of a specified
printer port that will work with Windows NT/98 as well as 95.

I currently use the following function to get printer status:

function TestPrinter(Port: Word): Boolean; pascal;
asm
        MOV AH,$02
        MOV DX,Port
        INT $17
        MOV @Result,1
        CMP AH,144
        JZ @@finish
        MOV @Result,0
@@finish:
end;

However, I understand that this will not work with NT/98 as they do not
allow direct access to ports.

I have searched the Windows API help to no avail so If anyone could provide
a solution to this I would be most grateful.

Thanks in advance.

Alex.

 

Re:How do I check printer status?


Check the following URL:
http://www.wideman-one.com/tech/Delphi/IOPM/index.htm

I have a similar problem where I have been using a LPT port as a very
efficient I2C bus. I have C++ code that I may try compiling to a DLL, but I
don't hold ou much hope. If you do hear of anything please mail me at
pch...@nospam.global.co.za - just remove the nospam from the address.

Doug Hubbard

Quote
Alex wrote in message <01bde639$cbeeef80$14bc3...@adw.wsatkins.co.uk>...
>Hi

>Does anyone know of a way of checking the current status of a specified
>printer port that will work with Windows NT/98 as well as 95.

>I currently use the following function to get printer status:

>function TestPrinter(Port: Word): Boolean; pascal;
>asm
> MOV AH,$02
> MOV DX,Port
> INT $17
> MOV @Result,1
> CMP AH,144
> JZ @@finish
> MOV @Result,0
>@@finish:
>end;

>However, I understand that this will not work with NT/98 as they do not
>allow direct access to ports.

>I have searched the Windows API help to no avail so If anyone could provide
>a solution to this I would be most grateful.

>Thanks in advance.

>Alex.

Other Threads