请问如何创建多个控制台窗口? 我想一个主的控制台运行运行过程中产生的消息,根据分类发送到不同的控制台显示出来?可以吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在你的程序里面createprocess就好了 STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); // Start the child process. if( !CreateProcess( NULL, // No module name (use command line). "cmd.exe", // Command line. 这里加个空格就可以输入命令 NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. FALSE, // Set handle inheritance to FALSE. 0, // No creation flags. NULL, // Use parent's environment block. NULL, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi ) // Pointer to PROCESS_INFORMATION structure. ) { return; } // Wait until child process exits. WaitForSingleObject( pi.hProcess, INFINITE ); // Close process and thread handles. CloseHandle( pi.hProcess ); CloseHandle( pi.hThread ); 建议使用AllocConsole。看看msdn吧。 给你找了个例子,看看吧,希望对你有帮助。http://www.codeproject.com/KB/cpp/MultipleConsoles.aspx?display=Print 求MSDN下载地址 有熟悉输入法编程的吗? fstream的问题 有人知道UBV协议么? 写个类怎么定时 关于mfc扩展dll中实现对话框的问题 网络游戏-外挂技术之疑问!!! Visual C++编程技巧大全 中文版? 那里可以下载The C++ Programming Languague 看到好多程序中在判断时很多人用 if (0 ==nRet) .c文件如何调用.cpp文件 [大规模求助] 帮我追姑娘吧
STARTUPINFO si;
PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) ); // Start the child process.
if( !CreateProcess( NULL, // No module name (use command line).
"cmd.exe", // Command line. 这里加个空格就可以输入命令
NULL, // Process handle not inheritable.
NULL, // Thread handle not inheritable.
FALSE, // Set handle inheritance to FALSE.
0, // No creation flags.
NULL, // Use parent's environment block.
NULL, // Use parent's starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi ) // Pointer to PROCESS_INFORMATION structure.
)
{
return;
} // Wait until child process exits.
WaitForSingleObject( pi.hProcess, INFINITE ); // Close process and thread handles.
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
http://www.codeproject.com/KB/cpp/MultipleConsoles.aspx?display=Print