- Код: Выделить всё
Private Const WM_USER As Long = &H400
Private Const EM_POSFROMCHAR As Long = (WM_USER + 38)
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Sub GetPosFromChar(ByVal lIndex As Long, ByRef xPixels As Long, ByRef yPixels As Long)
Dim lxy As Long
lxy = SendMessage(RTFBox_Hwnd, EM_POSFROMCHAR, lIndex, vbcNull)
xPixels = (lxy And &HFFFF&): yPixels = (lxy \ &H10000) And &HFFFF&
Debug.Print "lIndex " & lIndex & " ,"; Timer
Debug.Print "xPixels " & lxy & " ,"; Timer
Debug.Print "yPixels " & yPixels & " ,"; Timer
End Sub
После 65536(256*256) символа SendMessage возвращает 0 и снова включается примерно на 69700 символе! ???