--> Printer Driver Directory by delphi | Delphi Tips Trick

For Newbie

Tuesday, 15 November 2011

Printer Driver Directory by delphi

| Tuesday, 15 November 2011
checkk printer driverdirectory by delphi
Function to read the directory printer driver installed.



Function declaration:
PrinterDriverDir function: String;
var
   DM: TDeviceModeA;
   cDir: PChar;
   i: DWORD;
begin
   GetMem (cDir, MAX_PATH);
   GetPrinterDriverDirectory (nil, nil, 1, cDir, 200, i);
   Result: = StrPas (cDir);
   FreeMem (cDir);
end;

Add WinSpool units in uses.

Example of implementation:
TForm1.FormCreate procedure (Sender: TObject);
begin
   Edit1.Text: = PrinterDriverDir;
end;

Related Posts

No comments: