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

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -