Startupinfo startupinfo;//The information structure variables required to create the process
Getstartupinfo (&startupinfo);
Startupinfo.lpreserved=null;
Startupinfo.lpdesktop=null;
Startupinfo.lptitle=null;
startupinfo.dwx=0;
startupinfo.dwy=0;
startupinfo.dwxsize=0;
startupinfo.dwysize=0;
startupinfo.dwxcountchars=500;
startupinfo.dwycountchars=500;
Startupinfo.dwflags=startf_useshowwindow;
Startupinfo.wshowwindow=sw_hide;
Indicates that the process will execute in the background in a hidden way
startupinfo.cbreserved2=0;
Startupinfo.lpreserved2=null;
Startupinfo.hstdinput=stdin;
Startupinfo.hstdoutput=stdout;
Startupinfo.hstderror=stderr;
Process_information piprocess;
BOOL BRet;
BRet = CreateProcess (Modname,null,null,null,true,create_no_window, null,null,&startupinfo,&piprocess);
if (BRet)
CloseHandle (Piprocess.hthread);
CloseHandle (piprocess.hprocess);
Note that the Startupinfo.dwflags=startf_useshowwindow is necessary, otherwise ShowWindow parameters will be invalid, detailed MSDN written clearly
CreateProcess executes a console program that hides the DOS window