SHELLEXECUTEINFO sei;
DWORD exitcode;
memset(&sei,0,sizeof(SHELLEXECUTEINFO));
sei.cbSize = sizeof(SHELLEXECUTEINFO);
sei.fMask=SEE_MASK_NOCLOSEPROCESS;
sei.hwnd = NULL;
sei.lpFile = "";
sei.lpParameters = "";
sei.nShow = SW_SHOWNORMAL;
ShellExecuteEx(&sei);
GetExitCodeProcess(sei.hProcess,&exitcode);
if(exitcode==STILL_ACTIVE)
{
TerminateProcess(sei.hProcess,0);
}
這樣可以開啟一個程式 並且關閉它喔
沒有留言:
張貼留言