能否将某个console程序嵌到CView中并显示出来呢?并且使它的大小和该VIew的大小一样? 做个程序想做成这样,能实现吗?请教大侠! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 AllocConsole(); // 打开控制台窗口HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); // 取得输出句柄SetConsoleTitle("my console"); // 设控制台窗口标题Sleep(40); // 比你该死说要40毫秒才能保证标题设置完成HWND hWnd = FindWindow(NULL,"my console");BOOL MoveWindow( HWND hWnd, // handle to window int X, // horizontal position int Y, // vertical position int nWidth, // width int nHeight, // height BOOL bRepaint // repaint option); // MoveWindow到view的坐标BOOL WriteConsole( HANDLE hConsoleOutput, // handle to screen buffer CONST VOID *lpBuffer, // write buffer DWORD nNumberOfCharsToWrite, // number of characters to write LPDWORD lpNumberOfCharsWritten, // number of characters written LPVOID lpReserved // reserved); // 输出到控制台窗口// 程序结束时关闭CloseHandle(hStdOut);hStdOut = NULL;FreeConsole(); http://www.codeguru.com/Cpp/W-D/console/redirection/article.php/c541/ 创建进程时遇到的错误~ 控件问题 困扰了两天的问题,拜托高手帮忙! 模拟Windows画图的问题 有关ActiveMovive control控件的问题 怎么读取一个txt文件? 求教高手,监视一段时间内计算机所有的注册表信息和文件信息的变动情况? 如何得到本机IP地址的最后一个字段的值 共享MFC对象是指全部还是一些??????? 难道用fopen,fwrite,fseek,fread等标准C的函数操作文件时,就不能删除文件中的数据么? 典型的 VC++6。0里面的TCP协议的网络通信 ******网络超时,InternetException,判定HTML*******
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); // 取得输出句柄SetConsoleTitle("my console"); // 设控制台窗口标题
Sleep(40); // 比你该死说要40毫秒才能保证标题设置完成
HWND hWnd = FindWindow(NULL,"my console");BOOL MoveWindow(
HWND hWnd, // handle to window
int X, // horizontal position
int Y, // vertical position
int nWidth, // width
int nHeight, // height
BOOL bRepaint // repaint option
); // MoveWindow到view的坐标BOOL WriteConsole(
HANDLE hConsoleOutput, // handle to screen buffer
CONST VOID *lpBuffer, // write buffer
DWORD nNumberOfCharsToWrite, // number of characters to write
LPDWORD lpNumberOfCharsWritten, // number of characters written
LPVOID lpReserved // reserved
); // 输出到控制台窗口
// 程序结束时关闭
CloseHandle(hStdOut);
hStdOut = NULL;
FreeConsole();