Código:
Public Function GetTextBoxLine(hWnd As Long) As String
'INPUT: hWnd = Handle to text box
'OUTPUT: Text of specified TextBox Control
Dim lngLineCount As Long
Dim lngLineNumber As Long
Dim lngRet As Long
Dim lngLen As Long
Dim lngFirstCharPos As Long
Dim bytBuffer() As Byte
Dim strAns As String
'get number of lines
lngLineCount = SendMessage(hWnd, EM_GETLINECOUNT, 0, 0&)
For lngLineNumber = 0 To lngLineCount - 1
'first character position of the line
lngFirstCharPos = SendMessage(hWnd, EM_LINEINDEX, lngLineNumber, 0&)
'length of line
lngLen = SendMessage(hWnd, EM_LINELENGTH, lngFirstCharPos, 0&)
ReDim bytBuffer(lngLen) As Byte
bytBuffer(0) = lngLen
'text of line saved to bytBuffer
lngRet = SendMessage(hWnd, EM_GETLINE, lngLineNumber, bytBuffer(0))
If lngRet Then
strAns = strAns & Left$(StrConv(bytBuffer, vbUnicode), lngLen)
End If
Next
GetTextBoxLine = strAns
End Function
asi esta mi aproximacion de codigo pero no es asi me parece
Código:
long lngFirstCharPos = SendMessage(hWnd, EM_LINEINDEX, 0, 0);
int lngLen = SendMessage(hWnd, EM_LINELENGTH, lngFirstCharPos, 0);
chBuffer1[0] = lngLen;
long lngRet = SendMessage(hWnd, EM_GETLINE, 0, chBuffer1);
antes lo habia hecho asi pero tampoco recivia nada
Código:
char chBuffer1[MAX_PATH];//={0};
int t1=SendDlgItemMessage(hWnd, IDC_ART1, EM_GETLINE, 0, (LPARAM)(LPSTR)chBuffer1);//LB_GETSTRING
char asd[12];
sprintf(asd, "%d", t1);
MessageBox(hWnd,chBuffer1,asd,0);
agradezo su ayuda