Thread: This is how to get your program to run fullscreen (console)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    673

    Exclamation This is how to get your program to run fullscreen (console)

    EDIT: This edit is here because major small wanted me to point this out. This is a WINDOWS OS specific function (givin away by #include <windows.h>. So I would reccomend not using this program for anything other than personal use programs. If any one else has any other better ways of fullscreening let me know.



    Ok, alot of people I have noticed want to know how to get thier program to run in fullscreen right when you execute it so here is how
    Code:
    #include <iostream>
    #include <windows.h>
     
    using namespace std;
    //This Initiates the fullscreen function
    void fullscreen()
    {
    keybd_event(VK_MENU,0x38,0,0);
    keybd_event(VK_RETURN,0x1c,0,0);
    keybd_event(VK_RETURN,0x1c,KEYEVENTF_KEYUP,0);
    keybd_event(VK_MENU,0x38,KEYEVENTF_KEYUP,0);
    }
    //Below is where you would place your normal programming code.
    int main()
    {
    	fullscreen(); //This puts the window in fullscreen
    	cout << "Hello, See It Is Fullscreen.";
    	cin.get();
    	return 0;
    }
    Also note that to get back to your normal window just use the
    Code:
    fullscreen();
    function again. This little function has helped me alot for my porgramming. (instead of stretching the window to the resolution of your system.) This way no matter what computer you are using the program in it ALMOST always fits the screen perfectly.
    Last edited by Raigne; 11-24-2005 at 05:26 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MSVC++2008 console program portability
    By CodeMonkey in forum Windows Programming
    Replies: 1
    Last Post: 11-18-2008, 03:13 AM
  2. Help me with my basic program, nothing I create will run
    By Ravens'sWrath in forum C Programming
    Replies: 31
    Last Post: 05-13-2007, 02:35 AM
  3. Replies: 2
    Last Post: 12-22-2006, 08:45 PM
  4. plz help me run this program!!!
    By galmca in forum C Programming
    Replies: 8
    Last Post: 02-01-2005, 01:00 PM
  5. Just one Question?
    By Irish-Slasher in forum C++ Programming
    Replies: 6
    Last Post: 02-12-2002, 10:19 AM