设置Win98下的Epson LQ-1600K为默认打印机
print2:='Epson LQ-1600K,ESCP24SC,LPT1:';
//
var
WinIni : TIniFile;
WinIniFileName : array[0..MAX_PATH] of char;
szSection
char;
begin
if mode<>'work' then
exit;
GetWindowsDirectory(WinIniFileName,sizeof(WinIniFileName));
StrCat(WinIniFileName, '/win.ini');
WinIni := TIniFile.Create(WinIniFileName);
try
WriteProfileString('windows','device',pchar(print2)) ;
GetMem(szSection,10) ;
StrCopy(szSection,'Windows') ;
sendMessage(HWND_BROADCAST,WM_WININICHANGE,0,LongInt(szSection));
finally
WinIni.Free;
end;
end;