====== gettext ======
int gettext(int left, int top, int right, int bottom, void *dst)
==== description of gettext ====
copy text from a text mode window in memory.
stores the text content of the rectangular area of the screen, which is defined by left, top, right and bottom, and also stores it in the storage area pointed to by dst.
all coordinates are absolute screen coordinates, not window-based. The top left corner has coordinates (1,1). sequentially reads the contents of the rectangle from the left to right and from top to bottom in the memory.
each screen position is represented by 2 bytes in memory: The first byte contains the characters present in the cell, and the second byte contains the graphic attribute of the cell. The memory requirement for a rectangle with a width of w and a height of h columns goals is defined as follows:
bytes = (h line) x (w columns) x 2
returns returns 1 if the operation was successful else 0
#include
int main(void)
{
int i;
char buffer[79];
cprintf("This will be stored in the buffer"\n);
cprintf("This also"\n);
gettext(1, 1, 80, 25, buffer);
gotoxy(1, 25);
clrscr();
gotoxy(1, 25);
cprintf("hit some key to restore");
getch();
puttext(1, 1, 80, 25, buffer);
gotoxy(1, 25);
return 0;
}
===== output of gettext c example =====
This will be stored in the buffer
This also
hit some key to restore
This will be stored in the buffer
This also
...