NO

Author Topic: Hide console in the GLUT-project  (Read 3081 times)

d3dx

  • Guest
Hide console in the GLUT-project
« on: February 23, 2017, 12:15:31 PM »
Hello! :)
Please, help me.

How can I hide the console in the GLUT-project?

OS: Windows
« Last Edit: February 23, 2017, 12:17:06 PM by d3dx »

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: Hide console in the GLUT-project
« Reply #1 on: February 23, 2017, 09:37:05 PM »
Code: [Select]
//int main (int argc, char **argv)
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
{
glutInit(&__argc, __argv);
May the source be with you

d3dx

  • Guest
Re: Hide console in the GLUT-project
« Reply #2 on: February 25, 2017, 10:05:44 AM »
Thank you!

But this is true for Win32 project. I am interested in Console-project :)

I read this advice in the RED Book:

...
int main (int argc, char **argv)
{
char* argv = "";
int argc = 0;
glutInit(&argc, &argv);

...
}

But this method is not working...

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: Hide console in the GLUT-project
« Reply #3 on: February 27, 2017, 11:23:30 AM »
This code hide console window at runtime, but user see a flash of it at startup.
Code: [Select]
ShowWindow(GetConsoleWindow(),0);
May the source be with you

d3dx

  • Guest
Re: Hide console in the GLUT-project
« Reply #4 on: February 27, 2017, 11:31:07 AM »
Thank you very much!