Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Function GetLineText(CTextBox As TextBox, LineIndex As Long) As String Dim lc&, linechar& linechar = SendMessageBynum(CTextBox.hwnd, EM_LINEINDEX, LineIndex, 0) lc = SendMessageBynum(CTextBox.hwnd, EM_LINELENGTH, linechar, 0) + 1 GetLineText = String$(lc + 2, 0) Mid$(GetLineText, 1, 1) = Chr(lc And &HFF) Mid$(GetLineText, 2, 1) = Chr(lc \ &H100) lc = SendMessageBystring(CTextBox.hwnd, EM_GETLINE, LineIndex, GetLineText) GetLineText = left(GetLineText, lc) End Function
如上函数,如何声明SendMessageBynum和SendMessageBystring???
谢! |