Quello che sono riuscito a fare tramite codice con le API Win32 è questo:
Codice:
#define STRICT
#define _WIN32_WINNT 0x0500
#include <windows.h>
int main (void)
{
HANDLE hStdOut;
COORD c;
SMALL_RECT sr;
HWND hWnd;
hStdOut = GetStdHandle (STD_OUTPUT_HANDLE);
c = GetLargestConsoleWindowSize (hStdOut);
SetConsoleScreenBufferSize (hStdOut, c);
sr.Left = 0;
sr.Top = 0;
sr.Bottom = c.Y-1;
sr.Right = c.X-1;
SetConsoleWindowInfo (hStdOut, TRUE, &sr);
hWnd = GetConsoleWindow ();
SetWindowPos (hWnd, NULL, 0, 0, 0, 0, SWP_NOSIZE);
return 0;
}
Ho omesso, per brevità, i controlli sui valori di ritorno. Però funziona. Nota: ho usato la funzione GetConsoleWindow() che è disponibile solo da Win2000 in poi.