'listbox current selection
'   列表框视图滚动到当前选定的项。
'   hWndControl: 控件的句柄 (例如  HWND_FORM1_LISTBOX1)                  
'   nIndex:      要选择的字符串的从零开始的索引。
'   Returns:     If an error occurs, %LB_ERR is returned.
Function FF_ListBox_SetCurSel( ByVal hWndControl As HWND, ByVal nIndex As Long) As Long
    
    '检查窗口句柄是否有效
    If IsWindow(hWndControl) Then  
       ''发消息给控件
       Function = SendMessage( hWndControl, LB_SETCURSEL, nIndex, 0)
    Else
       Function = LB_ERR
    End If  
    
End Function             

