function Tfm_ICandOil.AlterPrint(PrName: String): Boolean;
var //选择打印机
WinIni:TIniFile;
WinIniFileName:Array[0..MAX_PATH] of char;
S:Array[0..64] of char;
begin
// PrName:='EPSON TM-U210D,HPPCL,LPT1:'
// if SelectPrint = 1 then
PrName:='EPSON TM-U210D,HPPCL,LPT1:';
GetWindowsDirectory(WinIniFileName,Sizeof(WinIniFileName));
StrCat(WinIniFileName,'/Win.ini');
WinIni:=TIniFile.Create(WinIniFileName);
try
WinIni.WriteString('Windows','Device',PrName);
finally
WinIni.Free;
end;
StrCopy(S,'Windows');
SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0 ,Longint(@S));
SelectPrint:=1;
//选择打印机(1)小票打印机,(2)报表打印机
end;