www.delorie.com/djgpp/doc/libc/libc_419.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]



#include <conio.h>

void    gettextinfo(struct text_info *_r);


This function returns the parameters of the current window on the screen. The return structure is this:

struct text_info {
    unsigned char winleft;
    unsigned char wintop;
    unsigned char winright;
    unsigned char winbottom;
    unsigned char attribute;
    unsigned char normattr;
    unsigned char currmode;
    unsigned char screenheight;
    unsigned char screenwidth;
    unsigned char curx;
    unsigned char cury;

The normattr field is the text attribute which was in effect before the program started.



Implementation Note

It's not safe to call this function inside static constructors, because conio needs to be initialized, and its initialization is done by a static constructor. Since you don't have any control on the order in which static constructors are called (it's entirely up to the linker), you could have problems.

If you can detect the situation when one of the conio functions is called for the very first time since program start, you could work around this problem by calling the gppconio_init function manually (this is the function called by a static constructor).

  webmaster     delorie software   privacy  
  Copyright © 2004     Updated Apr 2004