For Newbie

Tuesday, 15 November 2011

Printer Driver Directory by delphi

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;

Share on Facebook
Share on Twitter
Share on Google+

Related : Printer Driver Directory by delphi