
18.05.2015, 13:20
|
 |
LMD-DML
|
|
Регистрация: 12.07.2009
Адрес: Богородское
Сообщения: 3,025
Версия Delphi: D7E
Репутация: 1834
|
|
А можно и так, по drkb
Код:
Var
exInfo: TShellExecuteInfo;
Begin
FillChar( exInfo, Sizeof(exInfo), 0 );
With exInfo Do Begin
cbSize:= Sizeof( exInfo ); // required!
fMask := SEE_MASK_NOCLOSEPROCESS;
Wnd := Handle; // forms handle
lpVerb:= 'paintto';
lpFile:= Pchar( pdffilename );
lpParameters := PChar( printernameAndPort );
nShow := SW_HIDE;
End;
If ShellExecuteEx( @exInfo ) Then Begin
While GetExitCodeProcess( exinfo.hProcess, exitcode )
and (exitcode = STILL_ACTIVE)
Do
Sleep( 500 );
CloseHandle( exinfo.hProcess );
DeleteFile( pdffilename );
End
Else
ShowMessage(SysErrorMessage( GetLastError ));
|