I'm using the code below to get text from controls, if the text only contains English letters, it works well. Once there are unicode characters involved, then the text becomes unreadable code.
Code:
Private Sub GetTextFromControls(oControl as Object)
Dim lRC As Long
Dim byt() As Byte
Dim lTextLen As Long
lTextLen = SendMessage(oControl.Hwnd, WM_GETTEXTLENGTH, 0, 0)
If lTextLen > 0 Then
ReDim byt(1 To lTextLen) As Byte
Call SendMessage(oControl.Hwnd, WM_GETTEXT, ByVal lTextLen + 1, byt(1))
oForm.txtControlText.Text = " " & Trim(StrConv(byt, vbUnicode))
Else
oForm.txtControlText.Text = ""
End If
End Sub
For example, the text is "立即", oForm.txtControlText.Text will become "¨¢¡é?¡ä".
Thank you
Sniperhgy