关于ShellExecute怎么知道这个调用的exe文件已经执行完毕? ShellExecute(NULL,"open","deal.exe","c:\\","H:\\",SW_HIDE);我用一个循环调用这个deal.exe,怎么知道已经执行完毕?谢谢帮助! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 执行完了后弹出个MessageBox 不就行了 用createprocess()可以监视进程状态, ShellExecute () 不行CreateProcess( NULL, // No module name (use command line). (LPTSTR)(LPCTSTR)( cszFn1), // Command line. NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. FALSE, // Set handle inheritance to FALSE. 0, // No creation flags. NULL, // Use parent's environment block. NULL, // Use parent's starting directory. &start, // Pointer to STARTUPINFO structure. &proc ); // Pointer to PROCESS_INFORMATION structure.if (WaitForSingleObject(proc.hProcess, INFINITE) != WAIT_FAILED){ // yours} 也可以用ShellExecuteExSHELLEXECUTEINFO ShExecInfo = {0};ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;ShExecInfo.hwnd = NULL;ShExecInfo.lpVerb = "open";ShExecInfo.lpFile = "deal.exe"; ShExecInfo.lpParameters = "C:\\"; ShExecInfo.lpDirectory = "E:\\";ShExecInfo.nShow = SW_HIDE;ShExecInfo.hInstApp = NULL; if(ShellExecuteEx(&ShExecInfo)){WaitForSingleObject(ShExecInfo.hProcess,INFINITE);CloseHandle(ShExecInfo.hProcess);//程序执行完了} 求杜比环绕 c++ 源码,有知道别的什么开源项目里有杜比环绕的也行 如何向MFC中添加头文件 求助,怎么实现类似苹果ObjectDock的图标效果? List Control控件的内容如何插入到WORD文档中? 在网页内使用CSS后为什么用COM方法找不到body对象 问个巨弱的问题!~!在线 关于VC用ADO连接数据库的问题,急...... 公司要倒了,猴孙们要散了,我来散分 请问 \ 在宏定义中的作用 RasEnumConnections函数总报告错误,郁闷。 哪位高人可以提供一个遍历二叉树而不用递归的算法? 问一个很菜的问题,关于Excel
(LPTSTR)(LPCTSTR)( cszFn1), // Command line.
NULL, // Process handle not inheritable.
NULL, // Thread handle not inheritable.
FALSE, // Set handle inheritance to FALSE.
0, // No creation flags.
NULL, // Use parent's environment block.
NULL, // Use parent's starting directory.
&start, // Pointer to STARTUPINFO structure.
&proc ); // Pointer to PROCESS_INFORMATION structure.if (WaitForSingleObject(proc.hProcess, INFINITE)
!= WAIT_FAILED)
{
// yours
}
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = "open";
ShExecInfo.lpFile = "deal.exe";
ShExecInfo.lpParameters = "C:\\";
ShExecInfo.lpDirectory = "E:\\";
ShExecInfo.nShow = SW_HIDE;
ShExecInfo.hInstApp = NULL; if(ShellExecuteEx(&ShExecInfo))
{WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
CloseHandle(ShExecInfo.hProcess);
//程序执行完了
}