Hi all,
Can someone point me towards a Win32 API function for disabling the scrollbar in a windows console app?
Thanks.
Hi all,
Can someone point me towards a Win32 API function for disabling the scrollbar in a windows console app?
Thanks.
The scroll bar(s) appear automatically when the window size in either direction is smaller than the console screen buffer. To get rid of the scroll bar(s) reduce the screen buffer size in the required direction. Part 6 of my console tutorial shows how to do this.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
Cheers.
edit: Nice tutorials by the way, it has pretty much everything I need for my project. Thanks!
Ugh.. having a problem resizing the console buffer to a smaller size.
The call to SetConsoleScreenBuffer fails, with error message "87" which is as far as I can tell "Incorrect parameter". I am guessing it is due to an implicit type conversion on NewSBSize.X struct member, but no matter how I try I can't fix it. Any ideas?Code:#include <windows.h> #include <iostream> using namespace std; int main() { HANDLE hOut; CONSOLE_SCREEN_BUFFER_INFO SBInfo; COORD NewSBSize; int Status; hOut = GetStdHandle(STD_OUTPUT_HANDLE); GetConsoleScreenBufferInfo(hOut, &SBInfo); NewSBSize.X = SBInfo.dwSize.X - 2; NewSBSize.Y = SBInfo.dwSize.Y; Status = SetConsoleScreenBufferSize(hOut, NewSBSize); if (Status == 0) { Status = GetLastError(); cout << "SetConsoleScreenBufferSize() failed! Reason : " << Status << endl; exit(Status); } GetConsoleScreenBufferInfo(hOut, &SBInfo); cout << "Screen Buffer Size : "; cout << SBInfo.dwSize.X << " x "; cout << SBInfo.dwSize.Y << endl; return 0; }
I think it is more likely that you are trying to reduce the screen buffer to a size smaller than the window, you can't do that. The tutorial does mention this.
If you change the '- 2' to '+ 2' for example, the program runs, so it is not the type of argument, rather it's value that the call is objecting to.
If you want to make the screen buffer smaller, shrink the window first.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
Your right it does. It's probably a good idea to read everything isn't it. :/
Thanks.
The error you get back from GetLastError() is not really right because it implies a type error. It is something I raised with MS about 10 years ago, I doubt it'll change however.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
Yeah, I got suspicious when it couldn't be fixed with a typecast.The error you get back from GetLastError() is not really right because it implies a type error
Thanks.