Console scrolling

Posted on 2006-04-08
Last Modified: 2012-05-05
Hi, how can I remove and or disable scrolling my console applications?
I would like to have my programs so that the user can not scroll, and
even have it possibly where the scroll bars do not display.
Question by:List244
    LVL 86

    Accepted Solution

    #include <windows.h>
    #include <stdio.h>

    void DisableScrolling() {

    COORD cSize;
    HANDLE hCon = GetStdHandle(STD_OUTPUT_HANDLE);

    if (!GetConsoleScreenBufferInfo(hCon,&csbi)){

        printf("GetConsoleScreenBufferInfo: %d\n", GetLastError());

    cSize.X = csbi.srWindow.Right - csbi.srWindow.Left + 1;
    cSize.Y = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;

    if (!SetConsoleScreenBufferSize(hCon,cSize)){

        printf("SetConsoleScreenBufferSize: %d\n", GetLastError());

    void main () {


    LVL 8

    Author Comment

    Thanks again JKR.
    LVL 86

    Expert Comment

    ... and some background info: ("Window and Screen Buffer Size")

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
    What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
    The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
    The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now