>{$APPTYPE CONSOLE} >uses Windows, Printers, WinSpool, Variants; > >function IsPrinterMatrix: Boolean; >var > DeviceMode: THandle; > Device, Driver, Port: array [0..79] of Char; > pDevice, pDriver, pPort: PChar; >begin > > // Determinate that active printer is a Dot-Marix > Result:= False; > pDevice := @Device; > pDriver := @Driver; > pPort := @Port; > > Device := #0; > Driver := #0; > Port := #0; > > Printer.GetPrinter(pDevice, pDriver, pPort, DeviceMode); > > // Printer is dot-matrix when number of maximum colors = 16 > // and when printer prints TRUETYPE fonts as graphics > > if (GetDeviceCaps(Printer.Handle,NUMCOLORS)<=16) and > (DeviceCapabilities(pDevice, pPort,DC_TRUETYPE,nil,nil) = DCTT_BITMAP) > then > Result := True; >end; > >begin > writeln ('The current printer is ', Printer.Printers[Printer.PrinterIndex]); > > if IsPrinterMatrix then > writeln('Dot-Matrix Printer') > else > writeln('LaserJet or InkJet Printer'); >end. > >>