Prezado,,, a função abaixo não é a solução porém, poderá lhe ajudar:
{Checa Impressora WinXP} function IsPrinterWinXP : String; type TPrinterInfo = record SeverName : PChar; PrinterName : PChar; ShareName : PChar; PortName : PChar; DriverName : PChar; Comment : PChar; Location : PChar; DeviceMode : PDeviceModeA; SepFile : PChar; PrintProcessor : PChar; DataType : PChar; Parameters : PChar; SecurityDescriptor: PSecurityDescriptor; Attributes : Cardinal; DefaultPriority : Cardinal; StartTime : Cardinal; UntilTime : Cardinal; Status : Cardinal; Jobs : Cardinal; AveragePPM : Cardinal; end; function GetCurrentPrinterInformation: TPrinterInfo; function GetCurrentPrinterHandle: THandle; var Device, Driver, Port : array[0..255] of char; hDeviceMode: THandle; begin Printer.GetPrinter(Device, Driver, Port, hDeviceMode); if not OpenPrinter(@Device, Result, nil) then RaiseLastWin32Error; end; var hPrinter : THandle; pInfo: PPrinterInfo2; bytesNeeded: DWORD; PrinterInfo: TPrinterInfo; begin hprinter := GetCurrentPrinterHandle; try Winspool.GetPrinter( hPrinter, 2, Nil, 0, @bytesNeeded ); pInfo := AllocMem( bytesNeeded ); try Winspool.GetPrinter( hPrinter, 2, pInfo, bytesNeeded, @bytesNeeded ); Result.SeverName := pInfo^.pServerName; Result.PrinterName := pInfo^.pPrinterName; Result.ShareName := pInfo^.pShareName; Result.PortName := pInfo^.pPortName; Result.DriverName := pInfo^.pDriverName; Result.Comment := pInfo^.pComment; Result.Location := pInfo^.pLocation; Result.DeviceMode := pInfo^.pDevMode; Result.SepFile := pInfo^.pSepFile; Result.PrintProcessor := pInfo^.pPrintProcessor; Result.DataType := pInfo^.pDatatype; Result.Parameters := pInfo^.pParameters; Result.SecurityDescriptor := pInfo^.pSecurityDescriptor; Result.Attributes := pInfo^.Attributes; Result.DefaultPriority := pInfo^.DefaultPriority; Result.StartTime := pInfo^.StartTime; Result.UntilTime := pInfo^.UntilTime; Result.Status := pInfo^.Status; Result.Jobs := pInfo^.cJobs; Result.AveragePPM := pInfo^.AveragePPM; finally FreeMem( pInfo ); end; finally ClosePrinter( hPrinter ); end; end; var PrinterInfo: TPrinterInfo; begin PrinterInfo := GetCurrentPrinterInformation; Result:= 'Impressora: '+#13+PrinterInfo.PrinterName+#13+ 'Porta: '+PrinterInfo.PortName+#13+ 'Driver: '+PrinterInfo.DriverName+#13+ 'Location: '+'('+PrinterInfo.Location+')'+#13+ 'Status: '+'('+IntToStr(PrinterInfo.Status)+')'+#13+ 'Jobs: '+'('+IntToStr(PrinterInfo.Jobs)+')'+#13+ 'Server: '+'('+PrinterInfo.SeverName+')'+#13+ 'Share: '+'('+PrinterInfo.ShareName+')'; end; para testar: if IsPrinterWinXP<>'' then begin Mensagem('Verifique a '+IsPrinterWinXP,'Aviso...',mb_OK+mb_IconInformation); end else begin Mensagem('Impressora desligada ?'+#13+'Impressora instalada ?','Aviso...',mb_OK+mb_IconInformation); Abort; end; [ ]sss Henrique ----- Original Message ----- From: Consultores Software To: delphi-br@yahoogrupos.com.br Sent: Friday, October 24, 2008 11:57 AM Subject: [delphi-br] Teste de impressora matricial no windows xp Olá pessoal ! Procurei na internet rotinas que testam se a impressora matricial está online, na porta paralela, mas as que encontrei utilizam assembler e não funcionaram no windows xp. Alguém conhece outra rotina para teste de impressora em porta paralela, que funcione no windows xp ? Obrigado [As partes desta mensagem que não continham texto foram removidas] ------------------------------------------------------------------------------ No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.175 / Virus Database: 270.8.2/1743 - Release Date: 24-10-2008 08:33 [As partes desta mensagem que não continham texto foram removidas]