Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Go Back   Foros Club Delphi > Principal > Impresión
Register FAQ Members List Calendar Guía de estilo Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 27/10/2005
delphi.com.ar's Avatar
delphi.com.ar delphi.com.ar is offline
Federico Firenze
 
Join Date: May 2003
Location: Buenos Aires, Argentina *
Posts: 5,964
Poder: 29
delphi.com.ar Va camino a la fama
Te traduje un código que utilizo en otro lenguaje, a ver si te sirve:
Código Delphi [-]
unit SpoolUtils;

interface

uses
  Windows;

function GetPrinterStatus(APrinterName: PChar): DWORD;

implementation

uses
  Printers, WinSpool, SysUtils;

function GetPrinterStatus(APrinterName: PChar): DWORD;
var
  HPrinter: THandle;
  BytesNeeded: Cardinal;
  PrinterDefaults: PRINTER_DEFAULTS;
  PI2: ^PRINTER_INFO_2;
begin
  with PrinterDefaults do
  begin
    DesiredAccess := PRINTER_ACCESS_USE;
    pDatatype := nil;
    pDevMode := nil;
  end;

  Win32Check(OpenPrinter(APrinterName, HPrinter, @PrinterDefaults));
  try
    if not GetPrinter(HPrinter, 2, nil, 0, @BytesNeeded) then
    begin
      GetMem(PI2, BytesNeeded);
      try
        if GetPrinter(HPrinter, 2, PI2, BytesNeeded, @BytesNeeded) then
          Result := PI2^.Status
        else
          Result := MaxWord;
      finally
        FreeMem(PI2);
      end;
    end
    else
      Result := MaxWord;
  finally
    ClosePrinter(HPrinter);
  end;
end;

end.
Saludos!
__________________
delphi.com.ar

Dedique el tiempo suficiente para formular su pregunta si pretende que alguien dedique su tiempo en contestarla.
Reply With Quote
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +2. The time now is 05:30.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi