In order to avoid tangling with interop services (beyond my understanding) I use
spawnl(P_DETACH, MyPath, "MyProg.exe", 0);
to spawn a VS unmanaged C++ command line project. (It controls an astro-camera via the manufacturer's DLL).
I don't need and don't want a window (I talk to myprog.exe using named pipes from my main GUI program).
Suppressing the window from a GUI is trivial, but in order to avoid tangling with marshalling issues (beyond my comprehension) myprog.exe must be an unmanaged native C++ command line project, not a CLI project.
There is a huge literature on suppressing the window from a batch file or from python, and closing a window in a windows project is trivial, but that is all irrelevant here.
I spawn myprog.exe detached, but that is irrelevant. Closing the console handle executes ok but does not close the window.
Any thoughts on how to either never open the black onscreen DOS box, or how to close it without closing myprog.exe?
CreateProcesswithCREATE_NO_WINDOWin the process creation flags and/orSTARTF_USESHOWWINDOWandSW_HIDEin the appropriate slots ofSTARTUPINFO? (This is not an answer because I don't know if it will work.)