home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Source Code 1992 March
/
Source_Code_CD-ROM_Walnut_Creek_March_1992.iso
/
msdos
/
desqview
/
dvglue10.arc
/
TVQFIELD.C
< prev
next >
Wrap
C/C++ Source or Header
|
1988-07-10
|
1KB
|
43 lines
/*=======================================================*/
/* TVQFIELD.C */
/* */
/* (c) Copyright 1988 Ralf Brown */
/* All Rights Reserved */
/* May be freely copied for noncommercial use, so long */
/* as this copyright notice remains intact, and any */
/* changes are marked in the comment blocks preceding */
/* functions. */
/*=======================================================*/
#include <string.h>
#include "tvapi.h"
#include "tvstream.h"
/*=============================================*/
/* TVqry_field get contents of input field */
/* Ralf Brown 4/17/88 */
/*=============================================*/
int pascal TVqry_field(OBJECT win,int fld,int bufsize,char *buffer)
{
unsigned int size = TVqry_fieldsize(win,fld) ;
BYTE *stream = (BYTE *)malloc(size+6) ;
if (stream)
{
stream[0] = 0x1B ;
stream[1] = 0 ;
*((int *)(stream+2)) = size+2 ;
stream[4] = 0xF3 ;
stream[5] = fld ;
TVwin_stream(win,stream) ;
memcpy(buffer, (char *)(stream+6), (bufsize<size)?bufsize:size) ;
free(stream) ;
return TRUE ;
}
else
return FALSE ;
}
/* End of TVQFIELD.C */