hi,
Can any one help me to trap listview text from other application by passing window handle.
thx
PCM
Printable View
hi,
Can any one help me to trap listview text from other application by passing window handle.
thx
PCM
What do you mean by "trap"?
I guess you mean get the text from that listbox, maybe this works: (not tested)
Const WM_GETTEXT = &HD
Const WM_GETTEXTLENGTH = &HE
Private Declare Function SendMessageStr Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As String) 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
Function GetText(Handle As Long) As String
Dim lngLen As Long, Str As String
lngLen = SendMessage(Handle, WM_GETTEXTLENGTH, 0, 0)
Str = Space(lngLen + 1)
Call SendMessage(Handle, WM_GETTEXT, lngLen + 1, ByVal Str)
GetText = Str
End Function