Archived

This topic is now archived and is closed to further replies.

Basic Full Screen DOS ?

This topic is 5872 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How can I make my C++ application, using cout, cin, or printf, etc. functions, full screen with preferably a choise of the height, width of the screen, ex. 50*80 or 50*25 or whatever. I don''t want to use DX or GL or anything new just basic stuff for maybe a 2,3,486. Thanx Tazzel3D - Zach Maybe some ASM, example or whatever, I learn by examples.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
A console app? Just hit alt+Enter while the window has focus.

Share this post


Link to post
Share on other sites
All I want is so that in Windows, My DOS program start in fullscreen, and not the windowed thing it normally starts in. I need more space.

Thanx for the fast replies

TazzelD ~ Zach

Share this post


Link to post
Share on other sites

HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
int width = GetSystemMetrics(SM_CXMAXIMIZED),
height = GetSystemMetrics(SM_CYMAXIMIZED);
SMALL_RECT rect;
rect.Left = 0;
rect.Top = 0;
rect.Right = width;
rect.Bottom = height;
COORD c;
// the coords below should be in terms of rows and columns, not pixels
c.X = cols;
c.Y = rows;
SetConsoleScreenBufferSize(hConsole, c);
SetConsoleWindowInfo(hConsole, TRUE, &rect);

Share this post


Link to post
Share on other sites
I guess what I want to know to know what to do is create, update, etc what MSDN is calling a console. Oluseyi, I am very new to windows programming, and try to stay away from it most of the time, so, what else do I need for your code to work. I don''t even know how to create the consol.

Thanx for the quick replies.

Tazzeld ~ Zach

Share this post


Link to post
Share on other sites
Alternatively,

CONSOLE_SCREEN_BUFFER_INFO info;
GetConsoleScreenBufferInfo(hConsole, &info);
COORD c;
c.X = info.dwMaximumWindowSize.X;
c.Y = info.dwMaximumWindowSize.Y;
SetConsoleScreenBufferSize(hConsole, c);
c = GetLargestConsoleWindowSize(hConsole);
if(c.X == 0 && c.Y == 0)
return GetLastError();
rect.Left = rect.Top = 0;
rect.Right = c.X;
rect.Bottom = c.Y;
SetConsoleWindowInfo(hConsole, TRUE, &rect);

I haven''t used these functions much, so you''ll have to fool around with them to get the results you want.

Share this post


Link to post
Share on other sites
quote:
Original post by Tazzel3D
I guess what I want to know to know what to do is create, update, etc what MSDN is calling a console. Oluseyi, I am very new to windows programming, and try to stay away from it most of the time, so, what else do I need for your code to work. I don''t even know how to create the consol.

When you create a Win32 Console application (using main()), Windows allocates a console for you automatically. Using GetStdHandle() you can get a handle to that console and modify it. You''ll need to include <windows.h>.

Look up the declarations and descriptions of each of those functions in MSDN. And get comfortable with Win32 programming; it''s going to be around quite a while longer.

Share this post


Link to post
Share on other sites