Private Declare Function SendMessage Lib "USER" (ByVal hWnd As Integer, ByVal msg As Integer, ByVal wp As Integer, ByVal lp As Any) As Long
Private Declare Function SendMessageByNum Lib "USER" Alias "SendMessage" (ByVal hWnd As Integer, ByVal msg As Integer, ByVal wp As Integer, ByVal lp As Any) As Long
Const EM_GETLINE% = &H414
Private Sub cmdReadLine_Click()
Dim result&
Dim buffer As String * 60
Mid$(buffer$, 1, 1) = Chr$(60 And &HFF) ' First byte is the low 8 bits
Mid$(buffer$, 2, 1) = Chr$(60 \ 256) ' Second byte is the high 8 bits
result = SendMessage(txtControl.hWnd, EM_GETLINE, 2, ByVal buffer$)