改变缺省的打印机配置
(2)
procedure TForm1.Button1Click(Sender: TObject);
var
WinIni : TIniFile;
WinIniFileName : array[0..MAX_PATH] of char;
s : array[0..64] of char;
begin
GetWindowsDirectory(WinIniFileName,
sizeof(WinIniFileName));
StrCat(WinIniFileName, '/win.ini');
WinIni := TIniFile.Create(WinIniFileName);
try
WinIni.WriteString('windows', 'device','HP LaserJet
Series II,HPPCL,LPT1:');
finally
WinIni.Free;
end;
end;