EUGY » 23.02.2007 (Пт) 18:46
Если совсем на скорую руку и искомое окно "Edit"
Option Explicit
Private Type POINTAPI
x As Long
y As Long
End Type
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
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
Private Const EM_GETLINECOUNT = &HBA
Private Const EM_GETLINE = &HC4
Private Const EM_LINELENGTH = &HC1
Private Sub Form_Load()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim hwnds As Long
Dim s As String * 1024
Dim linecnt As Integer
Dim i As Integer
s = Space(1024)
Dim pt As POINTAPI
GetCursorPos pt
hwnds = WindowFromPoint(pt.x, pt.y)
linecnt = SendMessage(hwnds, EM_GETLINECOUNT, 0, 0)
For i = 0 To linecnt - 1
Call SendMessage(hwnds, EM_GETLINE, i, ByVal s)
Debug.Print Left(s, Len(Trim(s)) - 1)
Next
End Sub
'нервных просим не смотреть