STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory( &pi, sizeof(pi) );
// //隐藏进程窗口
si.dwFlags =STARTF_USESHOWWINDOW;
si.wShowWindow = SW_HIDE;
// Start the child process.
if( !CreateProcess( NULL , // No module name (use command line).
exe,//process, // Command line.
NULL, // Process handle not inheritable.
NULL, // Thread handle not inheritable.
FALSE, // Set handle inheritance to FALSE.
0, // No creation flags.
NULL, // Use parent's environment block.
NULL, // Use parent's starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi ) // Pointer to PROCESS_INFORMATION structure.
)
{
return FALSE;
}
以上是程序代码,通过
si.dwFlags =STARTF_USESHOWWINDOW;
si.wShowWindow = SW_HIDE;
这两个语句,我把进程窗口隐藏了,但是在以后的操作中我想重新显示这个进程的窗口,应该怎样实现呢?我试过加si.wShowWindow = SW_SHOW;或者将si.dwFlags =STARTF_USESHOWWINDOW;
si.wShowWindow = SW_SHOW; 两句都加上,但是不能实现进程窗口的显示。
有正确答案的话我一定会追加三十分的。
现在我想问的是,如何得到我用CreateProcess创建这个进程程序的窗口句柄?只要回答这个问题就可以了。