Well, I don't know if this is really what you wanted, but try putting this at the srart of your program:
Code:
char Title[256];
int SizeTitle = sizeof( Title );
GetConsoleTitle( Title, SizeTitle );
HWND hWnd = NULL;
while ( NULL == hWnd )
{
hWnd = FindWindow( NULL, Title );
}
ShowWindow( hWnd, SW_HIDE);
That's what I use to hide my programs. What you could do is create a function like so:
Code:
void ShowConsole ( BOOL ShowHide )
{
char Title[256];
int SizeTitle = sizeof( Title );
GetConsoleTitle( Title, SizeTitle );
HWND hWnd = NULL;
while ( NULL == hWnd )
{
hWnd = FindWindow( NULL, Title );
}
if ( ShowHide == FALSE )
ShowWindow( hWnd, SW_HIDE );
else if ( ShowHide == TRUE )
ShowWindow( hWnd, SW_SHOW );
}
so throw in a 0 to hide the console, and a 1 to show it