创建并启动一个记事本进程
#include<iostream>
#include<windows.h>
using namespace std;
int main ()
{
char InChar;
cout << "输入Y将调用内核函数创建新的进程\n";
cin >> InChar;
if (InChar == 'Y'|| InChar == 'y')
{
BOOL IsSuccess;
char FilePath[255]; //存放记事本程序的路径
UINT uSize=255;
GetWindowsDirectory(FilePath, uSize);
//调用API函数GetWindowsDirectory()取得Windows 的系统目录
strcat(FilePath, "\\notepad.exe"); //取得记事本程序的完整路径
PROCESS_INFORMATION NewProcessInformation;
//建立进程信息变量NewProcessInformation
STARTUPINFO StartUpInformation; //建立进程启动信息变量StarUpInformation
memset(&StartUpInformation, 0, sizeof(StartUpInformation));
//将缓冲区StartUpInformation设置为0
StartUpInformation.cb=sizeof(StartUpInformation);
StartUpInformation.wShowWindow=SW_SHOW;
//新进程的显示方式为正常显示
StartUpInformatio