quinta-feira, 11 de setembro de 2008

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;

Nenhum comentário: