This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/win/datactl/text.c

33 lines
730 B
C

#include <windows.h>
#include "ctltype.h"
BOOL ctl_text_start( ctl_elt *elt, HANDLE inst, HWND dlg, void *ptr )
/*******************************************************************/
/* start a text field */
{
inst = inst;
SetDlgItemText( dlg, elt->control, _str_ptr( ptr, elt ) );
return( TRUE );
}
BOOL ctl_text_finish( ctl_elt *elt, HANDLE inst, HWND dlg, void *ptr )
/********************************************************************/
/* end a text field */
{
char *str;
inst = inst;
str = _str_ptr( ptr, elt );
GetDlgItemText( dlg, elt->control, str, elt->info.text.text_size );
str[elt->info.text.text_size - 1]= '\0'; // in case of overflow
return( TRUE );
}