Moving the Character and Attribute Contents of a Window

You can transfer the character and attribute contents of designated parts of a window to a string, and vice versa, with the video copy video string function, v_vstcpy():

UINT v_vstcpy(vstp, dir, wn_part, wnp)
 
UCHAR *vstp;
/* Video string for window data
*/
int dir;
/* Direction of move (FROM_WN or TO_WN)
*/
int wn_part;    
/* Part of window to move from or to
*/
WINDOWPTR wnp;
/* Pointer to window to move to or from
*/

The arguments and functionality of v_vstcpy() are identical to v_stcpy(), except that rather than dealing with a standard character string, it deals with character-attribute pairs stored in a video string. A video string holds a sequence of characters. Following each character is its associated attribute. Because attributes can have the value zero, which is the value of the standard string terminator, '\0', video strings do not have a null terminator character.

A video string contains physical attributes, not logical attributes.

When the direction is specified as TO_WN, each character-attribute pair is written to one position in the window. When the direction is specified as FROM_WN, each character and its attribute are read from the screen and placed in the video string. No null terminator is appended.

v_vstcpy() returns the number of bytes it transferred, that is, the number of characters multiplied by two.


Home Contents Previous Next