C语言对一个窗口程序调用时关闭的疑问
请您看如下的代码:
#include <windows.h>
#include <stdio.h>
int main(void)
{
BOOL bNewProcess;
DWORD dwExternExitCode;
PROCESS_INFORMATION process_info;
STARTUPINFO startup_info = {sizeof(STARTUPINFO)};
bNewProcess = CreateProcess(TEXT("F:\\ef.exe"), NULL,
NULL, NULL,
FALSE, 0,
NULL, NULL,
&startup_info, &process_info);
if (!bNewProcess)
printf("%d\r\n", GetLastError());
//WaitForSingleObject(process_info.hProcess, 100000);
//GetExitCodeProcess(process_info.hProcess, &dwExternExitCode);
Sleep(100);
// close the process
TerminateProcess(process_info.hProcess, 0x00000001);
//printf("%d\r\n", dwExternExitCode);
return 0;
}
它可以停止 f:\\ef.exe 程序的运行吗??????