ShellExecute 실행 끝날때 까지 기다리기 | |||
| |||
uses ShellAPI; {Supply a fully qualified path name in ProgramName} procedure KShellExecute(exe, param, dir: String); var ExitCode: DWORD; SEInfo: TShellExecuteInfo; begin FillChar(SEInfo, SizeOf(SEInfo), 0); SEInfo.cbSize := SizeOf(TShellExecuteInfo); with SEInfo do begin fMask := SEE_MASK_NOCLOSEPROCESS; Wnd := Application.Handle; lpFile := PChar(exe); lpParameters := PChar(param); lpDirectory := PChar(dir); nShow := SW_SHOWNORMAL; end; if ShellExecuteEx(@SEInfo) then begin repeat Application.ProcessMessages; GetExitCodeProcess(SEInfo.hProcess, ExitCode); until (ExitCode <> STILL_ACTIVE) or Application.Terminated; end; end; Tags: shellexecute 윈도우즈 | |||
| |||
| |||
Login for comment |