Ver Mensaje Individual
  #2  
Antiguo 09-05-2007
Avatar de cHackAll
[cHackAll] cHackAll is offline
Baneado?
 
Registrado: oct 2006
Posts: 2.159
Reputación: 20
cHackAll Va por buen camino
Cool Solucion

La siguiente propiedad es la que el Delphi nos da, SOLO funciona cuando TU aplicacion imprime algo mediante la unidad "Printers"

Código Delphi [-]
uses Printers;
begin
 if Printer.Printing then ...
end.

Para saber si el S.O. está imprimiendo algo independientemente de tu aplicación pues te dejo el siguiente codigo:

Código Delphi [-]
uses WinSpool;
 
var Buffer: array [0..1024*1024-1] of Char;
 
function IsPrinting(lpPrinterName: PChar): LongBool;
var hPrinter, Count, Dummy: Cardinal; lpBuffer: PChar;
begin
 Result := False;
 if not OpenPrinter(lpPrinterName, hPrinter, nil) then Exit;
 lpBuffer := @Buffer;
 EnumJobs(hPrinter, 0, $FFFFFFFF, 1, lpBuffer, SizeOf(Buffer), Dummy, Count);
 ClosePrinter(hPrinter);
 while (Count <> 0) and not Result do
  begin
   Result := (PJobInfo1(lpBuffer).Status and JOB_STATUS_PRINTING) <> 0;
   Inc(lpBuffer, SizeOf(TJobInfo1));
   Dec(Count);
  end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
 if IsPrinting('Microsoft Office Document Image Writer') then
  Caption := 'Imprimiendo...'
 else
  Caption := 'Impresora inactiva.';
end;
Responder Con Cita