Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, _
ByVal lParam As Any) As Long
Const CB_FINDSTRING As Long = &H14C ' Meddelande som skickas med SendMessage()
Private Function Check(cmbBox As ComboBox, SearchStr, AddIfNotFound As Boolean) As Boolean
' Returnerar True om strängen återfanns i Comboboxen
'
'
If SendMessage(cmbBox.hwnd, CB_FINDSTRING, -1, CStr(SearchStr)) = -1 Then
If AddIfNotFound = True Then cmbBox.AddItem SearchStr 'Lägger till strängen i combon
Check = False
Else
' Söksträngen återfanns i combon
Check = True
End If
End Function