Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,395 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,119 people online right now. Registration is fast and FREE... Join Now!




Output Screen options

 
Reply to this topicStart new topic

Output Screen options

uclanstotty
22 Oct, 2006 - 03:44 AM
Post #1

New D.I.C Head
*

Joined: 13 Oct, 2006
Posts: 2



Thanked: 1 times
My Contributions
Is there a way to maximise / fullscreen the output screen in c++???
User is offlineProfile CardPM
+Quote Post

born2c0de
RE: Output Screen Options
22 Oct, 2006 - 10:15 AM
Post #2

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 3,935



Thanked: 34 times
Dream Kudos: 2800
Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
Nice....I never thought about writing code that does this before.
Here's what I could do...

Standard Window API Functions can't be directly used for Console Windows.
Instead, there are a few Console Specific API Functions that should be used.

Your code would look like this:
CODE

#include <windows.h>
#include <iostream.h>
#include <conio.h>

int main()
{
    HANDLE hOut;
    COORD NewSBSize;
    SMALL_RECT Area = {0, 0, 0, 0};

    hOut = GetStdHandle(STD_OUTPUT_HANDLE);

    NewSBSize = GetLargestConsoleWindowSize(hOut);

    SetConsoleScreenBufferSize(hOut, NewSBSize);

    Area.Right = NewSBSize.X - 1;
    Area.Bottom = NewSBSize.Y - 1;

    SetConsoleWindowInfo(hOut, TRUE,  &Area);

    cout<<"This is It.";
    getch();

    return 0;
}


Alternatively, you can simulate a double-click on the title bar which will result in the window to be maximized.
User is offlineProfile CardPM
+Quote Post

BitByte
RE: Output Screen Options
22 Oct, 2006 - 11:27 AM
Post #3

D.I.C Head
**

Joined: 9 Aug, 2006
Posts: 194



Thanked: 2 times
My Contributions
Here's a link that has a few console tricks, font colours etc..

Console tips
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/5/08 02:51AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month