Results 1 to 4 of 4

Thread: Search Boolean

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Location
    UK
    Posts
    123

    Search Boolean

    Can some one help me use this search Api to make a function where it searchs for some text and if it finds it, it sets a boolean called FoundTXT to true else if it doesn't then it sets it to false.

    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    Private Const LB_FINDSTRING = &H18F


    List1.ListIndex = SendMessage(List1.hwnd, LB_FINDSTRING, -1, ByVal CStr(text1.Text))

    Thanks to all in advance.

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    VB Code:
    1. If SendMessage(List1.hwnd, LB_FINDSTRING, -1, ByVal CStr(Text1.Text)) = -1 Then
    2.         FoundTXT = False
    3.     Else
    4.         FoundTXT = True
    5.     End If
    -= a peet post =-

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Location
    UK
    Posts
    123
    Thanks !!

  4. #4
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    your welcome

    the SendMessage used this way will always return the list item if found. if not found it will return -1
    -= a peet post =-

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width