-
May 11th, 2010, 01:19 PM
#1
Console window size
Hello all C++ guru's! I'm a student and I have a project in C++ B now.
I'm wondering if it's possible to change the size of a cmd / comman prompt / console window from within a program?
If you build a program and start it, you can right-click and choose properties and layout and there change the window size.
Are there any ways to do this internally? Thanks!
-
May 11th, 2010, 02:10 PM
#2
Re: Console window size
I am afraid to say that no one does that kind of console programming these days.
The options you are mentioning are applicable till Windows 2000. Starting with Windows XP, choosing those console options are no longer valid.
Furthermore, with Windows Vista and higher, you may not be able to full screen the console.
~ My condolences ~
-
May 11th, 2010, 04:03 PM
#3
Re: Console window size
Originally Posted by possemannen
I'm wondering if it's possible to change the size of a cmd / comman prompt / console window from within a program?
If you build a program and start it, you can right-click and choose properties and layout and there change the window size.
Are there any ways to do this internally? Thanks!
On Windows?
Check out SetConsoleWindowInfo Function.
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio:
FeinWindows - replacement windows manager for Visual Studio, and more...
-
May 11th, 2010, 09:42 PM
#4
Re: Console window size
I was about to refer those console APIs, but since he has already classified him as a student I did not!
-
May 14th, 2010, 11:49 AM
#5
Re: Console window size
Thanks for answers, but that doesn't seem to be just it. You know, standard character height is what? 8x6 pixels? But you can change that to something else and that's what I want to do from within my program. But maybe I'll figure out a way...
-
May 14th, 2010, 12:03 PM
#6
Re: Console window size
Get Microsoft Visual C++ Express here or CodeBlocks here.
Get STLFilt here to radically improve error messages when using the STL.
Get these two can't live without C++ libraries, BOOST here and Loki here.
Check your code with the Comeau Compiler and FlexeLint for standards compliance and some subtle errors.
Always use [code] code tags [/code] to make code legible and preserve indentation.
Do not ask for help writing destructive software such as viruses, gamehacks, keyloggers and the suchlike.
-
May 14th, 2010, 12:08 PM
#7
Re: Console window size
That function requires Windows Vista/2008 as minimum.
See Console functions.
-
May 14th, 2010, 12:15 PM
#8
Re: Console window size
Yes i know, there is no documented way to do it pre-vista, however in kernal32.dll is undocumented SetConsoleFont( HANDLE, DWORD) that could be used but its not so easy to find information about undocumented functions.
Get Microsoft Visual C++ Express here or CodeBlocks here.
Get STLFilt here to radically improve error messages when using the STL.
Get these two can't live without C++ libraries, BOOST here and Loki here.
Check your code with the Comeau Compiler and FlexeLint for standards compliance and some subtle errors.
Always use [code] code tags [/code] to make code legible and preserve indentation.
Do not ask for help writing destructive software such as viruses, gamehacks, keyloggers and the suchlike.
-
May 16th, 2010, 02:34 AM
#9
Re: Console window size
Wow, that's a nice link! Thanks guys!
What happens if I compile in vista and then runs the exe on xp?
And can someone please post a simple example of SetCurrentConsoleFontEx function?
Tags for this Thread
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
|