RAD Studio
ContentsIndex
PreviousUpNext
gettextinfo

Header File 

conio.h  

Category 

Console I/O Routines 

Prototype 

void gettextinfo(struct text_info *r); 

Description 

Gets text mode video information. 

gettextinfo fills in the text_info structure pointed to by r with the current text video information. 

The text_info structure is defined in conio.h as follows: 

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; /* BW40, BW80, C40, C80, or C4350 */ 

unsigned char screenheight; /* text screen's height */ 

unsigned char screenwidth; /* text screen's width */ 

unsigned char curx; /* x-coordinate in current window */ 

unsigned char cury; /* y-coordinate in current window */ 

};

Note: Do not use this function in Win32 GUI applications.
Return Value 

None. Results are returned in the structure pointed to by r. 

Example  

#include <conio.h>
int main(void)
 {
   struct text_info ti;
   gettextinfo(&ti);
   cprintf("window left      %2d\r\n",ti.winleft);
   cprintf("window top       %2d\r\n",ti.wintop);
   cprintf("window right     %2d\r\n",ti.winright);
   cprintf("window bottom    %2d\r\n",ti.winbottom);
   cprintf("attribute        %2d\r\n",ti.attribute);
   cprintf("normal attribute %2d\r\n",ti.normattr);
   cprintf("current mode     %2d\r\n",ti.currmode);
   cprintf("screen height    %2d\r\n",ti.screenheight);
   cprintf("screen width     %2d\r\n",ti.screenwidth);
   cprintf("current x        %2d\r\n",ti.curx);
   cprintf("current y        %2d\r\n",ti.cury);
   return 0;
}

Portability

POSIX 
Win32 
ANSI C 
ANSI C++ 
 
 
 
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!