Computing.Net > Forums > Programming > console apps

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

console apps

Reply to Message Icon

Name: saddam (by lurker)
Date: November 16, 2004 at 03:13:25 Pacific
OS: Windows XP
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: BlueRaja
Date: November 16, 2004 at 17:13:39 Pacific
Reply:

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


0

Response Number 2
Name: saddam (by lurker)
Date: November 16, 2004 at 23:25:52 Pacific
Reply:

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


0

Response Number 3
Name: BlueRaja
Date: November 17, 2004 at 20:13:59 Pacific
Reply:

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

AKhalifman@hotmail.com


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Win32: Reading a texts fr... Help regarding parallel p...



Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: console apps

help with console app in C++ www.computing.net/answers/programming/help-with-console-app-in-c/12107.html

stupid console apps www.computing.net/answers/programming/stupid-console-apps/10766.html

Resources issue on W2K. Service vs. App www.computing.net/answers/programming/resources-issue-on-w2k-service-vs-app/59.html