Pelles C forum

C language => Beginner questions => Topic started by: d3dx on February 23, 2017, 12:15:31 PM

Title: Hide console in the GLUT-project
Post by: d3dx on February 23, 2017, 12:15:31 PM
Hello! :)
Please, help me.

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

OS: Windows
Title: Re: Hide console in the GLUT-project
Post by: TimoVJL 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);
Title: Re: Hide console in the GLUT-project
Post by: d3dx 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...
Title: Re: Hide console in the GLUT-project
Post by: TimoVJL 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);
Title: Re: Hide console in the GLUT-project
Post by: d3dx on February 27, 2017, 11:31:07 AM
Thank you very much!