Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Impresión
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

 
 
Herramientas Buscar en Tema Desplegado
  #2  
Antiguo 27-10-2005
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.966
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.
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 13:43:51.


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