Ver Mensaje Individual
  #4  
Antiguo 21-08-2003
Avatar de delphi.com.ar
delphi.com.ar delphi.com.ar is offline
Federico Firenze
 
Registrado: may 2003
Ubicación: Buenos Aires, Argentina *
Posts: 5.933
Reputación: 27
delphi.com.ar Va por buen camino
Solo tendrías que crear una instancia de esa clase y usar sus propiedades, asignándole previamente el puerto de la impresora, sinó por defecto toma la impresora que este conectada al LPT1.
¿Sabes como hacerlo?


O puedes usar el otro código que hace lo mismo:
Código:
function PrinterStatus : integer; 
asm 
  mov ah, 2    // function 2 - returns status of port 
  mov dx, 0    // lpt1 = 0, lpt2 = 1 etc 
  int $17      // status in ah 
  mov al, ah 
  and eax, $FF // status now in eax with top 24 bits cleared 
end; 

const 
  PrinterCodes : array [0..7] of string = 
    ('printer timed-out', 
     'unused', 
     'unused', 
     'I/O error', 
     'printer selected', 
     'out of paper', 
     'printer acknowedgment', 
     'printer not busy'); 

procedure TForm1.Button1Click(Sender: TObject); 
var 
  L,P : integer; 
begin 
  P := PrinterStatus;  //status of printer in P 
  ListBox1.Clear; 
  for L := 0 to 7 do 
    if P and (1 shl L) <> 0 then 
      ListBox1.Items.Add (PrinterCodes [L]); 
end;
__________________
delphi.com.ar

Dedique el tiempo suficiente para formular su pregunta si pretende que alguien dedique su tiempo en contestarla.
Responder Con Cita