Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>gettextinfo() get current text window information</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 gettextinfo()           Get Current Text Window Information

 #include   <conio.h>

 void             gettextinfo(inforec);
 struct text_info inforec;

    gettextinfo() fills the 'text_info' structure pointed to by 'inforec'
    with the current text window information, including it's absolute
    screen coordinates, it's dimensions, the current video mode, the
    cursor's current position and the foreground and background colors.
    (The current video mode can be BW40, BW80, C40 or C80.)  The
    'text_info' structure is defined in <conio.h> as:

    struct text_info {
     unsigned char winleft;        /* left window coordinate */
     unsigned char wintop;         /* top window coordinate */
     unsigned char winright;       /* right window coordinate */
     unsigned char winbottom;      /* bottom window coordinate */
     unsigned char attribute;      /* text attribute */
     unsigned char normattr;       /* normal attribute */
     unsigned char currmode;       /* video mode */
     unsigned char screenheight;   /* bottom - top */
     unsigned char screenwidth;    /* right - left */
     unsigned char curx;           /* x coordinate in window */
     unsigned char cury;           /* y coordinate in window */
    };

       Returns:     Nothing. All information is stored in the 'text_info'
                    structure.

   Portability:     IBM PC and compatibles only.

   -------------------------------- Example ---------------------------------
    The following statements get the current window information and
    access two of the fields to find out where the cursor is in the
    current window.

           #include <conio.h>

           struct text_info tinfo;

           main()
           {
               int x_coord, y_coord;

               gettextinfo(&tinfo);
               x_coord = tinfo.curx;
               y_coord = tinfo.cury;
           }


See Also: textattr() textcolor() textmode() wherex() wherey() window()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson