Delphi Tips Trick

For Newbie

Iklan Responsive Atas

LightBlog
Responsive Ads Here

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;

No comments: