Windows下创建进程和线程(Console下使用API)[10]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

       //2.Open a file that coutain a set of commands

                     fid=fopen(argv[1],"r");

                     //3.For every command in the launch file

                     while(fgets(cmdLine,MAX_LINE_LEN,fid)!=NULL)

                     {

                            //Read a command from the file

                            if(cmdLine[strlen(cmdLine)-1]=='\n')

                                   cmdLine[strlen(cmdLine)-1]='\0';//Remove NEWLINE

                                  

                            //Create a new process to execute the command

                            ZeroMemory(&startInfo,sizeof(startInfo));

                            startInfo.cb=sizeof(startInfo);

本文关键:Windows下创建进程和线程(Console下使用API)
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top