'combo combobox insert
'   插入字符串到ComboBox控件
'   hWndControl: 控件的句柄 (例如  HWND_FORM1_COMBO1)
'   nIndex:      The zero-based index position to insert the string
'                into. Use -1 to add at the end of the list (or use
'                the FF_ComboBox_AddString function).
'   TheText:     要添加的实际文本。
'   Returns:     The index of the position at which the string was
'                inserted, or %CB_ERR if error occurred.
Function FF_ComboBox_InsertString(hWndControl as HWnd, nIndex as Long, TheText as CWSTR ) as Long
   
   '检查窗口句柄是否有效
   If IsWindow(hWndControl) Then
      '设置文本并返回插入文本的位置。
      Function = SendMessage(hWndControl, CB_INSERTSTRING, nIndex, Cast(LPARAM, TheText.vptr))
   Else
      Function = CB_ERR
   End If
   
End Function

