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
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.