home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 1.ddi / CLIB1.ZIP / VIDINFO.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-07  |  1.9 KB  |  50 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. /*|                                                              |*/
  11. /*|     Turbo C Run Time Library - Version 3.0                   |*/
  12. /*|                                                              |*/
  13. /*|                                                              |*/
  14. /*|     Copyright (c) 1987,1988,1990 by Borland International    |*/
  15. /*|     All Rights Reserved.                                     |*/
  16. /*|                                                              |*/
  17. /*[]------------------------------------------------------------[]*/
  18.  
  19. #include <_video.h>
  20. #include <conio.h>
  21.  
  22. /*---------------------------------------------------------------------*
  23.  
  24. Name            gettextinfo - give the user information on video mode,
  25.                               window coordinates and video attributes
  26.  
  27. Usage           #include <conio.h>
  28.                 void gettextinfo(struct text_info *r);
  29.  
  30. Prototype in    conio.h
  31.  
  32. Description     fills the text_info structure with the current video
  33.                 information.
  34.  
  35. Return value    None
  36.  
  37. NOTE: text_info structure is partial prefix of _video structure
  38.  
  39. *---------------------------------------------------------------------*/
  40. void gettextinfo(struct text_info *r)
  41. {
  42.         *r = *(struct text_info *)& _video;     /* move data all at once */
  43.         r->winleft      += 1;                   /* 1,1 origin */
  44.         r->wintop       += 1;
  45.         r->winright     += 1;
  46.         r->winbottom    += 1;
  47.         r->curx = wherex();
  48.         r->cury = wherey();
  49. }
  50.