Printing Delphi

procedure SetDefaultPrinter(const device: string);
var
IniFile: TIniFile;
begin
IniFile := TIniFile.Create('WIN.INI');
try
IniFile.WriteString('windows', 'device', device);
except
IniFile.Free;
raise;
end;
IniFile.Free;
SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0,
LPARAM(pchar('windows')));
end;
// Kullanimi:
procedure TForm1.Button1Click(Sender: TObject);
begin
SetDefaultPrinter('Lexmark');
end;