|
-
September 9th, 2008, 09:39 AM
#1
[RESOLVED] Size of Std Output
When you create a c++ console application, there is already a Std output buffer in the console window created. Is there anyway to get the size of that buffer or its handle so I could manipulate it with functions like WriteConsoleOutputCharacter?
Microsoft Visual Basic 2008 Express Edition
.NET Framwork 3.5 Beta SP1
-
September 9th, 2008, 10:10 AM
#2
Re: Size of Std Output
I don't think stdout is a buffer. It is a handle for a pseudo-file. I talk of stdout, like in
Code:
fprintf(stdout, "Hello, world!");
-
September 9th, 2008, 10:31 AM
#3
Re: Size of Std Output
 Originally Posted by olivthill
I don't think stdout is a buffer. It is a handle for a pseudo-file. I talk of stdout, like in
Code:
fprintf(stdout, "Hello, world!");
So there's no console buffer? Even if it is some sort of pseudo-file, given the console buffer you can take over that buffers standard output and put what you want there. I guess my question really is, what's the handle for the initial Console Buffer in a newly created console window?
Microsoft Visual Basic 2008 Express Edition
.NET Framwork 3.5 Beta SP1
-
September 9th, 2008, 11:01 AM
#4
Re: Size of Std Output
If you mean Windows, and you use WinAPI, there is a set of console functions: http://msdn.microsoft.com/en-us/libr...73(VS.85).aspx . You can use GetStdHandle to receive handle to an input/output device, or GetConsoleScreenBufferInfo[Ex] to receive console buffer info.
If you do not mean Windows, or not WinAPI, then I do not know. 
Cheers
B+!
'There is no cat' - A. Einstein
Use [code] [/code] tags!
Did YOU share your photo with us at CG Members photo gallery ?
-
September 10th, 2008, 01:06 AM
#5
Re: Size of Std Output
 Originally Posted by Hobson
If you mean Windows, and you use WinAPI, there is a set of console functions: http://msdn.microsoft.com/en-us/libr...73(VS.85).aspx . You can use GetStdHandle to receive handle to an input/output device, or GetConsoleScreenBufferInfo[Ex] to receive console buffer info.
If you do not mean Windows, or not WinAPI, then I do not know.
Cheers
I knew about those, but I should've thought more about GetStdHandle and GetConsoleScreenBufferInfo. My solution was to do this:
Code:
HANDLE hMap = GetStdHandle(STD_OUTPUT_HANDLE);
Which works, so thanks to everyone for their help.
Microsoft Visual Basic 2008 Express Edition
.NET Framwork 3.5 Beta SP1
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|