Click here to Skip to main content
15,895,781 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionInterceptApi Pin
GreenLantern10-Feb-06 17:19
GreenLantern10-Feb-06 17:19 
AnswerRe: InterceptApi Pin
GreenLantern14-Feb-06 11:39
GreenLantern14-Feb-06 11:39 
QuestiondirectX? Pin
gr8coaster32910-Feb-06 16:39
gr8coaster32910-Feb-06 16:39 
QuestionHELP ME FOR A GOOD START! Pin
DzungLean10-Feb-06 16:28
DzungLean10-Feb-06 16:28 
AnswerRe: HELP ME FOR A GOOD START! Pin
fearless stallion12-Feb-06 20:47
fearless stallion12-Feb-06 20:47 
QuestionMD2 HELP! Pin
DzungLean10-Feb-06 16:20
DzungLean10-Feb-06 16:20 
QuestionConsole Output Formatting Pin
Brett Peirce10-Feb-06 15:32
Brett Peirce10-Feb-06 15:32 
AnswerRe: Console Output Formatting Pin
EXTEIDE10-Feb-06 16:04
EXTEIDE10-Feb-06 16:04 
I found the code that you want in here.

http://www.koders.com/c/fidD1457B7594BFF764B76CFFDBCD7E2EDE2E4188C3.aspx?s=telnet

And I tested it like below, and I could get the result;

// consoletest.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <windows.h>
#include <conio.h>

void SetConsoleSize(HANDLE hConsole, SHORT xSize, SHORT ySize)
{
CONSOLE_SCREEN_BUFFER_INFO csbi; /* hold current console buffer info */
BOOL bSuccess;
SMALL_RECT srWindowRect; /* hold the new console size */
COORD coordScreen;

bSuccess = GetConsoleScreenBufferInfo(hConsole, &csbi);
/* get the largest size we can size the console window to */
coordScreen = GetLargestConsoleWindowSize(hConsole);
/* define the new console window size and scroll position */
srWindowRect.Right = (SHORT) (min(xSize, coordScreen.X) - 1);
srWindowRect.Bottom = (SHORT) (min(ySize, coordScreen.Y) - 1);
srWindowRect.Left = srWindowRect.Top = (SHORT) 0;
/* define the new console buffer size */
coordScreen.X = xSize;
coordScreen.Y = ySize;
/* if the current buffer is larger than what we want, resize the */
/* console window first, then the buffer */
if ((DWORD) csbi.dwSize.X * csbi.dwSize.Y > (DWORD) xSize * ySize)
{
bSuccess = SetConsoleWindowInfo(hConsole, TRUE, &srWindowRect);
bSuccess = SetConsoleScreenBufferSize(hConsole, coordScreen);
}
/* if the current buffer is smaller than what we want, resize the */
/* buffer first, then the console window */
if ((DWORD) csbi.dwSize.X * csbi.dwSize.Y < (DWORD) xSize * ySize)
{
bSuccess = SetConsoleScreenBufferSize(hConsole, coordScreen);
bSuccess = SetConsoleWindowInfo(hConsole, TRUE, &srWindowRect);
}
/* if the current buffer *is* the size we want, don't do anything! */
return;
}

int main(int argc, char* argv[])
{
HANDLE hStdout;

hStdout = GetStdHandle(STD_OUTPUT_HANDLE);

SetConsoleSize(hStdout, 100, 100);

printf("1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\n");
getch();

return 0;
}

EnjoyRose | [Rose]

Anderson Sheen
http://www.exteide.com

-- modified at 22:04 Friday 10th February, 20060ff>http://www.exteide.com</a></font></div>
QuestionLowLevelKeyboardHook Pin
blue_rabbit10-Feb-06 15:08
blue_rabbit10-Feb-06 15:08 
AnswerRe: LowLevelKeyboardHook Pin
EXTEIDE10-Feb-06 16:16
EXTEIDE10-Feb-06 16:16 
QuestionQ. how to access child frame data in childview Pin
sourabh27231810-Feb-06 14:04
sourabh27231810-Feb-06 14:04 
AnswerRe: Q. how to access child frame data in childview Pin
sourabh27231810-Feb-06 20:20
sourabh27231810-Feb-06 20:20 
QuestionHow to convert TCHAR to char Pin
transoft10-Feb-06 10:41
transoft10-Feb-06 10:41 
AnswerRe: How to convert TCHAR to char Pin
willy_total10-Feb-06 10:46
willy_total10-Feb-06 10:46 
AnswerRe: How to convert TCHAR to char Pin
try8810-Feb-06 15:43
try8810-Feb-06 15:43 
AnswerRe: How to convert TCHAR to char Pin
Ryan Binns12-Feb-06 17:22
Ryan Binns12-Feb-06 17:22 
QuestionNeed help in writing c program plzzzzzzzzzzz Pin
samsams10-Feb-06 9:56
samsams10-Feb-06 9:56 
AnswerRe: Need help in writing c program plzzzzzzzzzzz Pin
George L. Jackson10-Feb-06 10:11
George L. Jackson10-Feb-06 10:11 
AnswerRe: Need help in writing c program plzzzzzzzzzzz Pin
perlmunger10-Feb-06 11:27
perlmunger10-Feb-06 11:27 
QuestionI really do hate string streams Pin
PJ Arends10-Feb-06 9:49
professionalPJ Arends10-Feb-06 9:49 
AnswerRe: I really do hate string streams Pin
Jörgen Sigvardsson10-Feb-06 11:25
Jörgen Sigvardsson10-Feb-06 11:25 
AnswerRe: I really do hate string streams Pin
Jörgen Sigvardsson10-Feb-06 11:37
Jörgen Sigvardsson10-Feb-06 11:37 
GeneralRe: I really do hate string streams Pin
PJ Arends10-Feb-06 12:04
professionalPJ Arends10-Feb-06 12:04 
GeneralRe: I really do hate string streams Pin
Jörgen Sigvardsson10-Feb-06 12:15
Jörgen Sigvardsson10-Feb-06 12:15 
GeneralRe: I really do hate string streams Pin
PJ Arends10-Feb-06 12:22
professionalPJ Arends10-Feb-06 12:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.