Function GetListBoxStr(hLB As HWND, pos As Long, ByRef str As String) As Long
Dim Length As Long
Length = SendMessage(hLB,LB_GETTEXTLEN,pos,0)
str = ZeroString(Length)
If Length = 0 Then
GetListBoxStr = 0
Exit Function
End If
GetListBoxStr = SendMessage(hLB,LB_GETTEXT,pos,StrPtr(str))
SetDWord(StrPtr(str) - SizeOf (DWord), GetListBoxStr)
End Function
Function GetDlgLisBoxStr(hDlg As HWND, idLB As Long, pos As Long, ByRef str As String) As Long
GetDlgLisBoxStr = GetListBoxStr(GetDlgItem(hDlg, idLB), pos, str)
End Function
Sub MainWnd_ListBox1_SelChange()
Dim pos As Long
pos = SendMessage(GetDlgItem(hMainWnd,ListBox1),LB_GETCURSEL,0,0)
Dim Data As String
GetListBoxStr(GetDlgItem(hMainWnd,ListBox1),pos,Data)
SetWindowText(GetDlgItem(hMainWnd,EditBox2),Data)
End Sub
Sub MainWnd_ListBox1_SelChange()
Dim pos As Long
pos = SendMessage(GetDlgItem(hMainWnd,ListBox1),LB_GETCURSEL,0,0)
Dim Data As String
GetListBoxStr(GetDlgItem(hMainWnd,ListBox1),pos,Data)
SetWindowText(GetDlgItem(hMainWnd,EditBox2),Data)
End Sub
Sub MainWnd_ListBox1_SelChange()
Dim pos As Long
pos = SendMessage(GetDlgItem(hMainWnd,ListBox1),LB_GETCURSEL,0,0)
Dim Data As String
GetDlgLisBoxStr(hMainWnd,ListBox1,pos,Data)
SetWindowText(GetDlgItem(hMainWnd,EditBox2),Data)
End Sub
Sub MainWnd_ListBox1_SelChange()
> Dim pos As Long
> pos = SendMessage(GetDlgItem(hMainWnd,ListBox1),LB_GETCURSEL,0,0)
> Dim Data As String
> GetListBoxStr(GetDlgItem(hMainWnd,ListBox1),pos,Data)
> SetWindowText(GetDlgItem(hMainWnd,EditBox2),Data)
> End Sub
Sub MainWnd_ListBox1_SelChange()
> Dim pos As Long
> pos = SendMessage(GetDlgItem(hMainWnd,ListBox1),LB_GETCURSEL,0,0)
> Dim Data As String
> GetDlgLisBoxStr(hMainWnd,ListBox1,pos,Data)
> SetWindowText(GetDlgItem(hMainWnd,EditBox2),Data)
> End Sub