Annotation of mstools/samples/console/coninfo.c, revision 1.1.1.2

1.1       root        1: #include <windows.h>
                      2: #include <stdio.h>
                      3: #include "console.h"
                      4: 
1.1.1.2 ! root        5: /* Microsoft Developer Support
        !             6:    Copyright (c) 1992 Microsoft Corporation */
        !             7: 
1.1       root        8: /*******************************************************************
                      9: * FUNCTION: demoConInfo(HANDLE hConOut)                            *
                     10: *                                                                  *
                     11: * PURPOSE: demonstrate GetConsoleScreenBufferInfo. Get the current *
                     12: *          console screen buffer information and display it on the *
                     13: *          console.                                                *
                     14: *                                                                  *
                     15: * INPUT: console handle to output to                               *
                     16: *******************************************************************/
                     17: 
                     18: void demoConInfo(HANDLE hConOut)
                     19: {
                     20:   BOOL bSuccess;
                     21:   CONSOLE_SCREEN_BUFFER_INFO csbi;
                     22:   CHAR szTemp[128];
                     23: 
                     24:   setConTitle(__FILE__);
                     25:   bSuccess = GetConsoleScreenBufferInfo(hConOut, &csbi);
                     26:   PERR(bSuccess, "GetConsoleScreenBufferInfo");
                     27:   myPuts(hConOut, "For information on the console buffer, we need to call\n"
                     28:                   "GetConsoleScreenBufferInfo. Here is the information from\n"
                     29:                   "the buffer returned, the CONSOLE_SCREEN_BUFFER_INFO:");
                     30:   sprintf(szTemp, "Size: X = %d, Y = %d", csbi.dwSize.X, csbi.dwSize.Y);
                     31:   myPuts(hConOut, szTemp);
                     32:   sprintf(szTemp, "Cursor pos: X = %d, Y = %d", csbi.dwCursorPosition.X,
                     33:       csbi.dwCursorPosition.Y);
                     34:   myPuts(hConOut, szTemp);
                     35:   sprintf(szTemp, "Character display attribute: 0x%04x", csbi.wAttributes);
                     36:   myPuts(hConOut, szTemp);
                     37:   sprintf(szTemp, "Window position: Left = %d, Right = %d, Top = %d, "
                     38:       "Bottom = %d", csbi.srWindow.Left, csbi.srWindow.Top,
                     39:       csbi.srWindow.Right, csbi.srWindow.Bottom);
                     40:   myPuts(hConOut, szTemp);
                     41:   sprintf(szTemp, "Maximum window size: X = %d, Y = %d",
                     42:       csbi.dwMaximumWindowSize.X, csbi.dwMaximumWindowSize.Y);
                     43:   myPuts(hConOut, szTemp);
                     44:   myPuts(hConOut, "\nHit enter to return...");
                     45:   myGetchar();
                     46:   return;
                     47: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.