home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / EXTRAS / UUCODE / UUPC / TEST / UPC12ES1.ZIP / LIB / scrsiznt.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-11  |  2.8 KB  |  78 lines

  1. /*
  2.  *    $Id: scrsiznt.c 1.5 1993/09/26 03:32:27 dmwatt Exp $
  3.  *
  4.  *    $Log: scrsiznt.c $
  5.  *     Revision 1.5  1993/09/26  03:32:27  dmwatt
  6.  *     Use Standard Windows NT error message module
  7.  *
  8.  *     Revision 1.5  1993/09/26  03:32:27  dmwatt
  9.  *     Use Standard Windows NT error message module
  10.  *
  11.  *     Revision 1.4  1993/04/10  21:22:29  dmwatt
  12.  *     Windows/NT fixes
  13.  *
  14.  *     Revision 1.3  1992/12/30  13:09:25  dmwatt
  15.  *     Correct boolean compare
  16.  *
  17.  */
  18.  
  19. /*--------------------------------------------------------------------*/
  20. /*    Copyright (c) David M. Watt 1993, All Rights Reserved           */
  21. /*--------------------------------------------------------------------*/
  22.  
  23. /*--------------------------------------------------------------------*/
  24. /*    Changes Copyright (c) 1989-1993 by Kendra Electronic            */
  25. /*    Wonderworks.                                                    */
  26. /*                                                                    */
  27. /*    All rights reserved except those explicitly granted by the      */
  28. /*    UUPC/extended license agreement.                                */
  29. /*--------------------------------------------------------------------*/
  30.  
  31. /*--------------------------------------------------------------------*/
  32. /*                        System include files                        */
  33. /*--------------------------------------------------------------------*/
  34.  
  35. #include <stdio.h>
  36.  
  37. #include <windows.h>
  38.  
  39. /*--------------------------------------------------------------------*/
  40. /*                    UUPC/extended include files                     */
  41. /*--------------------------------------------------------------------*/
  42.  
  43. #include "lib.h"
  44. #include "scrsize.h"
  45. #include "pnterr.h"
  46.  
  47. /*--------------------------------------------------------------------*/
  48. /*                    Internal function prototypes                    */
  49. /*--------------------------------------------------------------------*/
  50.  
  51. currentfile();
  52.  
  53. /*--------------------------------------------------------------------*/
  54. /*    s c r s i z e                                                   */
  55. /*                                                                    */
  56. /*    Return screen size under Windows/NT                             */
  57. /*--------------------------------------------------------------------*/
  58.  
  59. short scrsize( void )
  60. {
  61.    CONSOLE_SCREEN_BUFFER_INFO info;
  62.    BOOL result;
  63.    HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
  64.  
  65.    result = GetConsoleScreenBufferInfo(hStdout, &info);
  66.  
  67.    if ( result != TRUE )
  68.    {
  69.       DWORD dwError = GetLastError();
  70.       printmsg(0,"scrsize:  could not retrieve screen information");
  71.       printNTerror("GetConsoleScreenBufferInfo", dwError);
  72.       return PAGESIZE;
  73.    }
  74.  
  75.    return info.dwSize.Y;
  76. } /* scrsize */
  77.  
  78.