SetConsoleWindowInfo function keeps returning false

I am trying to make myself a lightweight console graphic engine as a part of trying to learn the language and I came across this error while trying to resize the console window. Here is my code.

    Sc_Buffer = new CHAR_INFO[Sc_Width * Sc_Height];

    _ConsoleOut = GetStdHandle(STD_OUTPUT_HANDLE);

    if (_ConsoleOut == INVALID_HANDLE_VALUE)
    {
        MessageBox(NULL, TEXT("Invalid Output Handle."), TEXT("Error"), MB_OK);
        return FALSE;
    }
    else if (!SetConsoleActiveScreenBuffer(_ConsoleOut))
    {
        MessageBox(NULL, TEXT("Unable to Initialize screen buffer."), TEXT("Error"), MB_OK);
        return FALSE;
    }
    else if (!SetConsoleWindowInfo(_ConsoleOut, TRUE, &Sc_Range))
    {
        MessageBox(NULL, TEXT("Unable to set screen resolution."), TEXT("Error"), MB_OK);
        return FALSE;
    }

The last "if" statement for resizing the console keeps returning false and I can't seem to find a reason for it.

Please help. Thanks in advance.

Best regards!

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum