windows - Callback for running an external application in C++ -
i'm working on kinect v2 application @ point execute external unity mini game works kinect v2 well. i'm using shellexecute
function i'm not sure how implement callback notify main application once unity application has been closed. need because want pause kinect manager in main application once unity running own 1 (otherwise can imagine 2 kinect managers run @ same time). code right looks like:
if (button->gettag() == "something") { button->setactive(false); // todo pause kinect manager shellexecute(nullptr,l"open",l"unityapplication.exe",nullptr,nullptr,sw_shownormal); // todo know once unity applications has been closed // todo resume kinect manager }
use shellexecuteex
instead of shellexecute
, passing flag see_mask_nocloseprocess
in fmask
field of shellexecuteinfo
structure, , either waitforsingleobject
or registerwaitforsingleobject
on process handle returned in hprocess
field of shellexecuteinfo
structure.
Comments
Post a Comment