首页 > 编程知识 正文

引起进程创建的8个事件(容器窗口管理进程无法就绪)

时间:2023-05-03 16:15:16 阅读:72499 作者:1633

相关函数可参考MFC帮助文档; 高水平的大山pclass自觉的酒窝/p {

公共:

CExeCommandLine (

{m_si.CB=sizeof(m_si ); //窗口隐藏cmd窗口;

m _ si.dwflags=startf _ use show window|startf _ usestdhandles;

m_si.wShowWindow=SW_HIDE;

(} ~CExeCommandLine () ) ) )。

{

TerminateExe (;

} private:

STARTUPINFO m_si;

PROCESS_INFORMATION m_pi; 公共:

ool execmd (字符串矩阵) )。

{

//开始the child process。

if (! createprocess (空,//nomodulename ) usecommandline )。

strexecmd.getbuffer(0),//Command line。

空值,//Process handle not inheritable。

空值,//Thread handle not inheritable。

FALSE,//Set handle inheritance to FALSE。

0,//no创建标志。

NULL,//use parent ' s环境块。

空值,//Use parent's starting directory。

m_si,//pointertostartupinfostructure。

m _ pi//pointertoprocess _ information structure。

{

//error exit (' createprocess failed.' ); 返回0;

}strExecmd.ReleaseBuffer (; 高山p返回真; } BOOL TerminateExe () ) )。

{

if(m_pi.hprocessm_pi.hthread ) )。

{

DWORD dwEC=0; BOOL b=GetExitCodeProcess (

m_pi.hProcess,//handle to the process

dwec//终端状态

); 是if(b )

{

}//close process and thread handles。

closehandle(m_pi.hprocess;

closehandle(m_pi.hthread;

}

m_si.CB=sizeof(m_si ); 返回真;

};

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。