title: Reducing console size
body: <p>I got a problem with changing console size. This is my code:</p>
  
  <pre><code>BOOL setConsole(int x, int y)
  {
  hStdin = GetStdHandle(STD_INPUT_HANDLE); 
  hStdout = GetStdHandle(STD_OUTPUT_HANDLE); 
  if (hStdin == INVALID_HANDLE_VALUE || 
      hStdout == INVALID_HANDLE_VALUE) 
  {
      MessageBox(NULL, TEXT("GetStdHandle"),
          TEXT("Console Error"), MB_OK);
      return false;
  }
  
  
  SMALL_RECT windowSize = {0, 0, x-1, y-1};
  
  // Change the console window size:
  SetConsoleWindowInfo(hStdout, TRUE, &amp;windowSize);
  
  COORD c = { x, y};
  
  //Change the internal buffer size:
  SetConsoleScreenBufferSize(hStdout, c);
  
  
  SetConsoleDisplayMode(hStdout,CONSOLE_FULLSCREEN_MODE, &amp;c);
  
  return true;
  }
  </code></pre>
  
  <p>It works perfectly fine, when I try to enlarge the console. When one parameter is smaller than previous one nothing happens. What is wrong?</p>
  
  <p>@edit: after some tests I noticed, that resizing(reducing) is possible if I change one parameter at once. Example(assume console is 100x100)</p>
  
  <pre><code> setConsole(90,90); //dosen't work.
   setConsole(90,100);
   setConsole(90,90); // works perfectly
  </code></pre>
  
  <p>WHY?!</p>