uses WinSpool, Printers;
procedure TForm1.FormCreate(Sender: TObject);
begin
Combobox1.Items.Assign(Printer.Printers);
Combobox1.itemindex := 0;
ComboBox1Change(Sender);
Richedit1.Font.Name := 'Courier New';
Richedit1.Font.Size := 10;
Richedit1.Wordwrap := false;
Richedit1.Scrollbars := ssBoth;
end;
procedure TForm1.ComboBox1Change(Sender: TObject);
var
h: THandle;
cdn: Cardinal;
Info: PDriverInfo2;
begin
Richedit1.clear;
OpenPrinter(PChar(Combobox1.Text), h, nil);
GetPrinterDriver(h, nil, 2, Info, 0, cdn);
GetMem(Info, cdn);
if GetPrinterDriver(h, nil, 2, Info, cdn, cdn)
then begin
Richedit1.Lines.Add('Drucker Name ==> ' + Info.pName);
Richedit1.Lines.Add('Treiber Pfad ==> ' + Info.pDriverPath);
Richedit1.Lines.Add('Drucker Daten ==> ' + Info.pDataFile);
Richedit1.Lines.Add('Konfiguration ==> ' + Info.pConfigFile);
end else Richedit1.Lines.Add('FEHLER');
ClosePrinter(h);
FreeMem(Info);
end;