Ver Mensaje Individual
  #1  
Antiguo 29-06-2006
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.107
Reputación: 34
dec Tiene un aura espectaculardec Tiene un aura espectacular
Cómo saber si una impresora está lista

Cómo saber si una impresora paralelo está lista

Código Delphi [-]
AssignFile(IMpresora,'lpt1');   // Impresora : TExtFile;
{$I-}
Rewrite(Impresora);
{$I+}
if ioresult<>0 then ERROR
otra forma usando ensamblador

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