I have been playing around with editing Windows OS console windows. While I was able to successfully disable resizing the console window, I am having trouble disabling the vertical scroll bar that appears to the right of the console. I have tried the following code:
#define _WIN32_WINNT 0x0500
#include <iostream>
#include <Windows.h>
int main() {
HWND consoleWindow = GetConsoleWindow();
SetWindowLongPtr(consoleWindow, GWL_STYLE,
GetWindowLong(consoleWindow, GWL_STYLE)
& ~WS_MAXIMIZEBOX & ~WS_SIZEBOX & ~WS_VSCROLL);
char misc;
std::cout << "Hello World!";
std::cin >> misc;
return 0;
}
I was under the impression the "& ~WS_VSCROLL" segment would disable the vertical scrollbar by modifying that part of the window style, just as the "& ~WS_MAXIMIZEBOX & ~WS_SIZEBOX" disabled resizing. How, then, may I disable the scrollbar?