View Full Version: starting a fullscreen console

C++ Learning Community > C++ Tips > starting a fullscreen console


Title: starting a fullscreen console
Description: i dident write this but.....


ih8censorship - August 19, 2003 01:11 AM (GMT)
hey recently i was wondering how to start a console window in fullscreen mode. i searched around the 'net a bit and heres all i could find:
CODE


#include <windows.h>

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


int main()
{

fullscreen();
return 0;
}
it works, but it leaves me wondering isnt there a simpler way to make a console go automaticaly fullscreen?


p.s. if someone changed the backround and made it flash your desktop it would be a good prank ;)

TheHawgMaster - August 20, 2003 05:19 AM (GMT)
I dont have a reference handy, so I could be wrong; but maybe you could do it by getting a handle to the console via CreateFile() then using SetConsoleScreenBufferInfo() or a similar function to set it to fullscreen. Only problem with this technique is that it would take alot more of much more complex code than simply simulating a selection of the fullscreen option on the menu (What your example does).




* Hosted for free by InvisionFree