Testando se a impressora está OnLine

Veja nesta dica como saber se a impressora está OnLine.

Testando se a impressora está OnLine

function PrinterOnLine : Boolean;
Const
  PrnStInt : Byte = $17;
  StRq : Byte = $02;
  PrnNum : Word = 0; { 0 para LPT1, 1 para LPT2, etc. }
Var nResult : byte;
Begin (* PrinterOnLine*)
  Asm
    mov ah,StRq;
    mov dx,PrnNum;
    Int $17;
    mov nResult,ah;
  end;
  PrinterOnLine := (nResult and $80) = $80;
End;

Artigos relacionados