Advertisement
Gov_777

ShellExecuteEx

Jun 13th, 2016
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.54 KB | None | 0 0
  1. var
  2.   ExecInfo: TShellExecuteInfo;
  3. begin
  4. if FileExists(ExtractFilePath(ParamStr(0))+'document.doc') then begin
  5.   ZeroMemory(@ExecInfo, sizeof(ExecInfo));
  6.   with ExecInfo do
  7.   begin
  8.     cbSize := sizeOf(ExecInfo);
  9.     fMask  := SEE_MASK_NOCLOSEPROCESS;
  10.     lpVerb := PChar('open');
  11.     lpFile := pchar(ExtractFilePath(ParamStr(0))+'document.doc');
  12.     nShow  := 1;
  13.   end;
  14.   ShellExecuteEx(@ExecInfo);
  15.   if ExecInfo.hInstApp<32
  16.   then WaitForInputIdle(ExecInfo.hProcess, 10000) end else
  17. ShowMessage('Файл отсутствует!');
  18. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement