Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
When I create C/C++ console applications they run in its own window. But how do I get a console app to run in full screen mode without pressing Alt + Enter. I have seen programs that have done that.
saddam

Well, I've done it two different ways.
The first, and recommended, way of doing it is to use the SetConsoleDisplayMode() function.The second way is to use the code I stole off of some guy a long time ago (sorry I can't give any names):
void AltEnter()
{
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);
return;
}Basically, it emulates the user pressing alt+enter. This method is cheap, and thus, frowned upon by most programmers.
Remember to add the correct header files (don't know where each function comes from, so you'll have to look it up on MSDN).
AKhalifman@hotmail.com

Hi,
Thanks for the code.
The first method is probably for newer applications but the second is for 16-bit windows applications. But why use these numbers 0x38 and 0x1c are they addresses of IRQs or port call addresses?
saddam

I'd assume that would be the hex numbers of the keys...
Again, I stole that code from someone else.
lol.AKhalifman@hotmail.com

![]() |
Win32: Reading a texts fr...
|
Help regarding parallel p...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |