我想一个主的控制台运行
运行过程中产生的消息,根据分类发送到不同的控制台显示出来?
可以吗?

解决方案 »

  1.   

    在你的程序里面createprocess就好了
      

  2.   


     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 );
      

  3.   

    建议使用AllocConsole。看看msdn吧。
      

  4.   

    给你找了个例子,看看吧,希望对你有帮助。
    http://www.codeproject.com/KB/cpp/MultipleConsoles.aspx?display=Print