1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| var
SEInfo: TShellExecuteInfo;
ExitCode: DWORD;
//..
//
FillChar(SEInfo, SizeOf(SEInfo), 0);
SEInfo.cbSize := SizeOf(TShellExecuteInfo);
SEInfo.fMask := SEE_MASK_NOCLOSEPROCESS;
SEInfo.Wnd := Self.Handle;
SEInfo.lpVerb := PChar('print');
SEInfo.lpFile := PChar(sFilename);
SEInfo.nShow := SW_HIDE;
if ShellExecuteEx(@SEInfo) then
repeat
Sleep(250);
GetExitCodeProcess(SEInfo.hProcess, ExitCode) ;
until (ExitCode <> STILL_ACTIVE) or Application.Terminated
else
MessageDlg('Erreur d''impression de ' + sFilename, mtError, [mbOK], 0); |
Partager