NO

Author Topic: Startup Window in Console mode  (Read 3268 times)

GreenHornet

  • Guest
Startup Window in Console mode
« on: August 17, 2011, 04:36:31 PM »
Hi All,

How do I get a compiled program to startup in a maximumized window? Thanks. :)

        GH

CommonTater

  • Guest
Re: Startup Window in Console mode
« Reply #1 on: August 17, 2011, 08:56:33 PM »
If it's console mode, you don't.

Really... Vista and Win7 no longer support full screen text mode windows.

If you are on XP or 2000 you can type ALT-Enter to max out the window.

But the big question is... Why would you want to?

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Startup Window in Console mode
« Reply #2 on: August 17, 2011, 09:51:08 PM »
Code: [Select]
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

#pragma comment(lib, "user32.lib")

int main(int argc, char **argv)
{
ShowWindow(GetConsoleWindow(), SW_MAXIMIZE);
return 0;
}
May the source be with you

CommonTater

  • Guest
Re: Startup Window in Console mode
« Reply #3 on: August 17, 2011, 10:31:27 PM »
Code: [Select]
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

#pragma comment(lib, "user32.lib")

int main(int argc, char **argv)
{
ShowWindow(GetConsoleWindow(), SW_MAXIMIZE);
return 0;
}

On my XP box that opened a full screen window.
On the Win7 machine it just made it the usual width but the full height of the screen.
« Last Edit: August 17, 2011, 10:33:54 PM by CommonTater »

GreenHornet

  • Guest
Re: Startup Window in Console mode
« Reply #4 on: August 18, 2011, 05:53:59 PM »
Thanks!

#define WIN32_LEAN_AND_MEAN
#include <windows.h>

#pragma comment(lib, "user32.lib")

int main(int argc, char **argv)
{
   ShowWindow(GetConsoleWindow(), SW_MAXIMIZE);
   return 0;
}

The reason I would want to do this is to do game textual programming. Starting at the bottom so to speak.

GH