当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

    摘要: 我在快捷方式中没法加卸载啊?怎么办啊?有高手指导啊? ......
    摘要: http://pop.pcpop.com/showhomerecommend.aspx?recommendid=352 有点恐怖。。。 ......


关于ShellExecute怎么知道这个调用的exe文件已经执行完毕

ShellExecute(NULL,"open","deal.exe","c:\\","H:\\",SW_HIDE);  
   
  我用一个循环调用这个deal.exe,怎么知道已经执行完毕?  
  谢谢帮助!

NO.1   作者: gxc

用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   parents   environment   block.    
                  NULL,                           //   Use   parents   starting   directory.    
                  &start,                             //   Pointer   to   STARTUPINFO   structure.  
                  &proc   );                           //   Pointer   to   PROCESS_INFORMATION   structure.  
   
  if   (WaitForSingleObject(proc.hProcess,   INFINITE)  
  !=   WAIT_FAILED)  
  {  
        //   yours  
  }

NO.2   作者: shw014

也可以用ShellExecuteEx  
   
  SHELLEXECUTEINFO   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);  
  //程序执行完了  
  }  
   
 


    摘要: 我使用pq合并分区时出现故障,死机重启后f盘消失windows不能识别,单在pq中可识别为故障盘但没有修复键. f盘有10gb数据 拜托高手火速救援 小弟对分区表不熟请详细赐教 拜托! ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE