应用ShellExecute等待另一进程终止

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 bigfanofcpp 的 blog

   shellexecuteinfo exeinfo;
   exeinfo.cbsize = sizeof(shellexecuteinfo);
   exeinfo.fmask = (see_mask_doenvsubst|see_mask_flag_ddewait|0x04000000|see_mask_nocloseprocess|see_mask_no_console);
   exeinfo.hwnd = null;
   exeinfo.lpverb = "open";
   exeinfo.lpfile = (lpctstr)路径&文件名;
   exeinfo.lpparameters = null;
   exeinfo.lpdirectory = null;
   exeinfo.nshow = sw_shownormal;
   exeinfo.hinstapp = null;
   exeinfo.lpidlist = null;
   exeinfo.lpclass = null;
   exeinfo.hkeyclass = null;
   exeinfo.dwhotkey = null;
   exeinfo.hmonitor = null;
   exeinfo.hicon = null;
   exeinfo.hprocess = null;
   
   ::shellexecuteex(&exeinfo);
   if(exeinfo.hprocess)
   {
     ::waitforsingleobject(exeinfo.hprocess,infinite);
     ::closehandle(exeinfo.hprocess);
   }

本文关键:应用ShellExecute等待另一进程终止
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top