c++ - how to get return value of an exe called by ShellExecute -
how return value of exe called shellexecute function.
shellexecute(null, null, text ( ".\\dpinstx86.exe" ), null, null, sw_shownormal); in above example want return value of "dpinstx86.exe".
use shellexecuteex instead process handle, , getexitcodeprocess exit code.
shellexecuteinfo shexecinfo = {0}; shexecinfo.cbsize = sizeof(shellexecuteinfo); shexecinfo.fmask = see_mask_nocloseprocess; shexecinfo.hwnd = null; shexecinfo.lpverb = null; shexecinfo.lpfile = "c:\\myprogram.exe"; shexecinfo.lpparameters = ""; shexecinfo.lpdirectory = null; shexecinfo.nshow = sw_show; shexecinfo.hinstapp = null; shellexecuteex(&shexecinfo); waitforsingleobject(shexecinfo.hprocess,infinite);
Comments
Post a Comment