ShellExecuteEx를 이용한 커맨드라인 기반 어플리케이션 실행 | |||
| |||
종료가 끝날때 까지 기다리는 프로그램을 구현하고자 한다면, 다음을 참조하기 바란다. #include <shellapi.h> void KShellExecute(HWND handle, LPCTSTR exe, LPCTSTR param, LPCTSTR dir) { DWORD ExitCode; SHELLEXECUTEINFO SEInfo; memset( &SEInfo, 0, sizeof(SEInfo)); SEInfo.cbSize = sizeof(SHELLEXECUTEINFO); SEInfo.fMask = SEE_MASK_NOCLOSEPROCESS; SEInfo.hwnd = handle; SEInfo.lpFile = exe; SEInfo.lpParameters = param; SEInfo.lpDirectory = dir; SEInfo.nShow = SW_HIDE; // SW_SHOWNORMAL; if (ShellExecuteEx(&SEInfo)==TRUE) { do { GetExitCodeProcess(SEInfo.hProcess, &ExitCode); Sleep(500); } while (ExitCode); // wait until the command is finished } } Tags: ShellAPI ShellExecuteEx 윈도우즈 | |||
| |||
| |||
로그인을 하시면 댓글을 등록 할 수 있습니다. |
OTHER POSTS IN THE SAME CATEGORY Windows XP Shutdown(윈도우종료) 빠르게 하기 |