Click to See Complete Forum and Search --> : Resizing the console
Strix Varia
October 12th, 2005, 08:56 PM
Is is possible to resize the console window so that when your program starts, the console is not at its default size? For example, if you open a command prompt, right click on the title bar, and go to Properties, you can change the window dimensions on the Layout tab. Is there a way to set these dimensions in your code so that they are customized when your program starts running?
Thanks
Calculator
October 12th, 2005, 10:02 PM
Check out ::SetConsoleDisplayMode(..) (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/setconsoledisplaymode.asp)
Strix Varia
October 12th, 2005, 10:28 PM
I sort of understand that.
Follow up question though... does it matter which development environment I'm using? Just out of curiosity, because that's from MSDN and I'm currently working with Bloodshed Dev-C++.
SuperKoko
October 13th, 2005, 09:46 AM
No, it does not matter.
You must just compile a Win32 PE executable.
::SetConsoleDisplayMode is an API of the kernel32.dll of Win32 OS.
However, you can perfectly use this function in debug versions of your program, but it is preferable to don't use in the release of your program, if you want that your program run on old Windows, because it does not exists before Windows XP. Even Windows 2000 and Windows Me don't support this function.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.