'listbox add string
'   将字符串添加到列表框控件
'   hWndControl: 控件的句柄 (例如  HWND_FORM1_LISTBOX1)
'   TheText:     要添加的实际文本。
'   Returns:     The zero-based index where the text was added.  
Function FF_ListBox_AddString(ByVal hWndControl as HWnd, ByRef TheText as CWSTR ) as Long
   
   '检查窗口句柄是否有效
   If IsWindow(hWndControl) Then
      ''发消息给控件
      Function = SendMessageW(hWndControl, LB_ADDSTRING, 0, Cast(LPARAM, TheText.vptr))
   Else
      Function = LB_ERR
   End If
   
End Function

