Delphi Tips Trick

For Newbie

Iklan Responsive Atas

LightBlog
Responsive Ads Here

Tuesday, 15 November 2011

Default Printer Name Reading the default printer.



Function declaration:
PrinterDef function: string;
var
   sStr: array [0 .. 255] of Char;
begin
   GetProfileString ('Windows', 'device','', sStr, 255);
   Result: = StrPas (sStr);
end;

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



default printer name delphi

No comments: