Welcome
Welcome to the forums of AntiRTFM's Absolute N00b Spoonfeed C++ Tutorials!

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!

Full screen mode - WINDOWS based

Display your little helpful snippets of code that may help us all get something done

Full screen mode - WINDOWS based

Postby Argio on Fri Jun 20, 2008 5:18 am

Well if you really want to you can make your program run in full screen mode, add this to your program at the top of main or in a function, but with a function please place it at the top of main.

GREAT for tet adventures


Code: Select all
#include <iostream>
#include <conio.h> //For the getch() to stop program
#include <windows.h> //WIN API lib


using namespace std; //Standard name space


int main(int argc,char *argv[])
{
   
   //Win API code to start the program in full screen mode

   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);

   //Proof of it working!

   cout << "Brought to you by Argio" << endl;

   getch();
}
User avatar
Argio
 
Posts: 21
Joined: Fri Jun 20, 2008 5:04 am
Location: Utah. I am jewish.

Postby antiRTFM on Fri Jun 20, 2008 7:57 am

Please don't forget to mention that this is of course windows platform specific thus it uses non-standard c++.
User avatar
antiRTFM
Administrator
 
Posts: 462
Joined: Sun Apr 13, 2008 9:10 am

Postby Marss++ on Sun Aug 03, 2008 12:07 am

Yeah... I wish we could have a thread or a tutorial on what things are windows specific. And what is actually considered to be standard C++.


No offense to anyone. I just don't think people know what that is because no one ever told them.
I'm a 15 year old kid who has his heart set on Programming.

Came here hoping to help so if you have any questions just ask!
Marss++
 
Posts: 149
Joined: Fri Jul 18, 2008 3:20 pm

Re: Full screen mode - WINDOWS based

Postby GrimSoul on Mon Jul 27, 2009 4:48 pm

I dont mean offence, and am not bashing you, or your code. But if i was a newbie i would not understand the code. It is good to explain what it is your code is doing, instead of just putting it here for noobs who dont want to learn and to just copy+paste. It emulates ALT+Enter correct? Which when done in DOS prompt will enable full screen.

I dont want to act like a mod, but if people never explained code, i wouldnt be as good as a programmer as i am today.
Do not underestimate my post count.

Image
GrimSoul
 
Posts: 8
Joined: Thu Jul 23, 2009 7:27 pm

Re: Full screen mode - WINDOWS based

Postby zorro59 on Wed Jul 29, 2009 5:32 am

You can also emulate space + alt as in my program...
That way you can also minimize it...
zorro59
 
Posts: 77
Joined: Tue May 12, 2009 2:28 am


Return to Snippets

Who is online

Users browsing this forum: No registered users and 0 guests