能力值:
( LV2,RANK:10 )
|
-
-
2 楼
好吧,我自己顶下,大牛快快出现啊
|
能力值:
( LV2,RANK:10 )
|
-
-
3 楼
Maybe AllocConsole works for you.
|
能力值:
( LV2,RANK:10 )
|
-
-
4 楼
谢谢。其实我想在调用telnet程序时,不弹出窗口,但是telnet程序并没有调用这个函数啊,求高人指点迷津
|
能力值:
( LV2,RANK:10 )
|
-
-
5 楼
从库里抓一个出来给你,DLL中创建控制台我就用的它,哈哈!
// Creates a console, need to call FreeConsole before exit
VOID CreateConsole(CONST CHAR * winTitle)
{
INT hConHandle = 0;
HANDLE lStdHandle = 0;
FILE *fp = 0 ;
// Allocate the console
AllocConsole();
// Set a title if we need one
if(winTitle) SetConsoleTitleA(winTitle);
// redirect unbuffered STDOUT to the console
lStdHandle = GetStdHandle(STD_OUTPUT_HANDLE);
hConHandle = _open_osfhandle(PtrToUlong(lStdHandle), _O_TEXT);
fp = _fdopen(hConHandle, "w");
*stdout = *fp;
setvbuf(stdout, NULL, _IONBF, 0);
// redirect unbuffered STDIN to the console
lStdHandle = GetStdHandle(STD_INPUT_HANDLE);
hConHandle = _open_osfhandle(PtrToUlong(lStdHandle), _O_TEXT);
fp = _fdopen(hConHandle, "r");
*stdin = *fp;
setvbuf(stdin, NULL, _IONBF, 0);
// redirect unbuffered STDERR to the console
lStdHandle = GetStdHandle(STD_ERROR_HANDLE);
hConHandle = _open_osfhandle(PtrToUlong(lStdHandle), _O_TEXT);
fp = _fdopen(hConHandle, "w");
*stderr = *fp;
setvbuf(stderr, NULL, _IONBF, 0);
}
}
|
能力值:
( LV2,RANK:10 )
|
-
-
6 楼
一会儿 试一下 呵呵
|
能力值:
( LV2,RANK:10 )
|
-
-
7 楼
#ifndef _CONSOLE
if (!AllocConsole())
return false;
#endif
freopen("CON", "r", stdin );
freopen("CON", "w", stdout);
freopen("CON", "w", stderr);
|
|
|