home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / winui / console / getlrgst.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-10-05  |  1.9 KB  |  43 lines

  1.  
  2. /******************************************************************************\
  3. *       This is a part of the Microsoft Source Code Samples. 
  4. *       Copyright (C) 1993-1997 Microsoft Corporation.
  5. *       All rights reserved. 
  6. *       This source code is only intended as a supplement to 
  7. *       Microsoft Development Tools and/or WinHelp documentation.
  8. *       See these sources for detailed information regarding the 
  9. *       Microsoft samples programs.
  10. \******************************************************************************/
  11.  
  12. #include <windows.h>
  13. #include <stdio.h>
  14. #include "console.h"
  15.  
  16. /*********************************************************************
  17. * FUNCTION: demoGetLargest(HANDLE hConOut)                           *
  18. *                                                                    *
  19. * PURPOSE: demonstrate GetLargestConsoleWindowSize. Reports the size *
  20. *          of the largest possible console window, given the current *
  21. *          font.                                                     *
  22. *                                                                    *
  23. * INPUT: console input handle to query the information from and to   *
  24. *        output to                                                   *
  25. *********************************************************************/
  26.  
  27. void demoGetLargest(HANDLE hConOut)
  28. {
  29.   COORD coordLargest; /* hold the largest window size */
  30.   CHAR szTemp[128];
  31.  
  32.   setConTitle(__FILE__);
  33.   coordLargest = GetLargestConsoleWindowSize(hConOut);
  34.   PERR(coordLargest.X | coordLargest.Y, "GetLargestConsoleWindowSize");
  35.   myPuts(hConOut, "The largest console window size for this console, as\n"
  36.                   "reported by GetLargestConsoleWindowSize, is:");
  37.   sprintf(szTemp, "%d wide by %d high.", coordLargest.X, coordLargest.Y);
  38.   myPuts(hConOut, szTemp);
  39.   myPuts(hConOut, "\nHit enter to return...");
  40.   myGetchar();
  41.   return;
  42. }
  43.