I based my function on one which was provided as an answer on a different query here (C++ How to remove vertical scrollbar?), and when I initially used it, it worked fine, however now it has stopped working.
I've copied the other person's solution into mine, and that doesn't work either.
This is my copied code in the main function to try and trim it down as much as possible and it's still not working:
int main() {
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO screenBuffer;
GetConsoleScreenBufferInfo(hStdOut, &screenBuffer);
screenBuffer.dwSize.X = screenBuffer.dwMaximumWindowSize.X;
screenBuffer.dwSize.Y = screenBuffer.dwMaximumWindowSize.Y;
SetConsoleScreenBufferSize(hStdOut, screenBuffer.dwSize);
HWND window = GetConsoleWindow();
ShowScrollBar(window, SB_BOTH, FALSE);
getchar();
return 0;
}