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

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

本文简介:

              tmpInt=(INTEGER*)malloc(sizeof(INTEGER));

              tmpInt->data=i;

              CreateThread(NULL,0,threadWork,tmpInt,0,&targetThreadID);

              Sleep(100);//Let newly created thread run

       }

       //Cycle while children work...

       while(runFlag)

       {

              GetSystemTime(&now);

              if((now.wMinute>=stopTimeMinute)&&(now.wSecond>=stopTimeSecond))

                     runFlag=FALSE;

              Sleep(1000);

       }

       Sleep(5000);

       printf("Program ends successfully\n");

}

 

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

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

go top