我想实现这样一个功能,用CWinThread开启一个console窗口和两个线程,线程1每5秒向console窗口写thread1(用printf),线程2每7秒向console窗口写thread2现在有几个问题 
1. 如何开启一个console窗口,我现在是
CWinThread *thread1 = new CWinThread(thread1,NULL);
thread1 ->CreateThread(CREATE_NEW_CONSOLE,0,NULL);
CREATE_NEW_CONSOLE 似乎并没有开启一个新的console窗口具体该怎么实现2.thread2如何得到thread1开启的窗口的输出流(应该是要这样吧)3.主线程如何终止 thread1程序的执行,依靠CWinThread *thread1指针
     我看到有 thread1->SuspendThread() ,但没看到有 thread1->exitThread()  之类的啊 /**************************下面是部分源码,求好心人帮我完善下********************************/
unsigned int thread1(void *param)
{
while(1)
{
Sleep(5000);
printf("thread1\n");
}
return 0;
}unsigned int thread2(void *param)
{
CWinThread *t1 =(CWinThread *)param;
//这里要怎样靠t1来重定向t2的输出流
while(1)
{
Sleep(7000);
printf("thread2\n");
}
return 0;
}void CTestApp::test()
{
CWinThread  t1 = new CWinThread(thread1,NULL);
CWinThread  t1->CreateThread(CREATE_NEW_CONSOLE,0,NULL); //这里怎样开启一个console窗口
CWinThread  t2 = new CWinThread(thread2,(void *)&t1);
CWinThread  t2->CreateThread(CREATE_NEW_CONSOLE,0,NULL); Sleep(100000);

//这里怎样结束t1,t2线程
}