get text from listbox
- From: "RB Smissaert" <bartsmissaert@xxxxxxxxxxxxxxxx>
- Date: Wed, 30 Nov 2005 17:04:14 -0000
Trying to get the text of items in a listbox of an external application. This code will get me some data, but it is in non-readable form like this: ¸îA`
Private Declare Function SendMessageLong Lib "user32" _
Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, ByVal wParam As Long, _
ByVal lParam As Long) As Long
Private Declare Function SendMessageStr Lib "user32" _
Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, ByVal wParam As Long, _
ByVal lParam As String) As Long
Private Const LB_GETTEXT = &H189 Private Const LB_GETCOUNT = &H18B
Sub test()
Dim r As Long Dim i As Long Dim maxItems As Long Dim listStr As String Dim lLBhwnd As Long
lLBhwnd = 7275646
maxItems = SendMessageLong(lLBhwnd, LB_GETCOUNT, 0, 0)
For i = 0 To maxItems - 1
listStr = Space$(64)
r = SendMessageStr(lLBhwnd, LB_GETTEXT, i, listStr)
If r > 0 Then
MsgBox Left$(listStr, r)
End If
NextEnd Sub
Would there be a way to get the readable data?
RBS
.
- Follow-Ups:
- Re: get text from listbox
- From: mayayana
- Re: get text from listbox
- From: Karl E. Peterson
- Re: get text from listbox
- From: Dave
- Re: get text from listbox
- From: Kevin Provance
- Re: get text from listbox
- From: Thorsten Albers
- Re: get text from listbox
- From: Juergen Thuemmler
- Re: get text from listbox
- Prev by Date: Re: How to read and write information in internet
- Next by Date: Re: get text from listbox
- Previous by thread: Re: open DSS file with MCI commands?
- Next by thread: Re: get text from listbox
- Index(es):
Relevant Pages
|
Loading