home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 1.ddi / CLIBSRC1.ZIP / VIDINFO.C < prev   
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.4 KB  |  49 lines

  1. /*-----------------------------------------------------------------------*
  2.  * filename - vidinfo.c
  3.  *
  4.  * function(s)
  5.  *        gettextinfo  - give the user information on video mode,
  6.  *                       window coordinates and video attributes
  7.  *-----------------------------------------------------------------------*/
  8.  
  9. /*
  10.  *      C/C++ Run Time Library - Version 5.0
  11.  *
  12.  *      Copyright (c) 1987, 1992 by Borland International
  13.  *      All Rights Reserved.
  14.  *
  15.  */
  16.  
  17.  
  18. #include <_video.h>
  19. #include <conio.h>
  20.  
  21. /*---------------------------------------------------------------------*
  22.  
  23. Name            gettextinfo - give the user information on video mode,
  24.                               window coordinates and video attributes
  25.  
  26. Usage           #include <conio.h>
  27.                 void gettextinfo(struct text_info *r);
  28.  
  29. Prototype in    conio.h
  30.  
  31. Description     fills the text_info structure with the current video
  32.                 information.
  33.  
  34. Return value    None
  35.  
  36. NOTE: text_info structure is partial prefix of _video structure
  37.  
  38. *---------------------------------------------------------------------*/
  39. void gettextinfo(struct text_info *r)
  40. {
  41.         *r = *(struct text_info *)& _video;     /* move data all at once */
  42.         r->winleft      += 1;                   /* 1,1 origin */
  43.         r->wintop       += 1;
  44.         r->winright     += 1;
  45.         r->winbottom    += 1;
  46.         r->curx = wherex();
  47.         r->cury = wherey();
  48. }
  49.