estoy tratando de leer el contenido que se ingresa a un editbox el cual esta en un dialogbox secundario .... encontre este codigo en visual basic que no entiendo muy bien pero trate de pasarlo a c o de entender al menos lo que hace, pero no entiendo como hacer esto aun
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
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
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 :)
Windows Controls (http://msdn.microsoft.com/en-us/library/windows/desktop/bb773173%28v=VS.85%29.aspx).
el problema estaba en el parametro que le pasaba a sendmessage, no devia pasarle el manejador del dialogo sino el manejador del editbox ::)
ahora ando la cosa