searching listbox for a string

This is a discussion on searching listbox for a string within the Windows Programming forums, part of the Platform Specific Boards category; i have a string and if it's already in teh listbox, i dont want to put it in there again. ...

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    157

    searching listbox for a string

    i have a string and if it's already in teh listbox, i dont want to put it in there again. isnt there a message you can send the listbox for it to search if a certain string is already in there? if so, what are the WPARAM and LPARAM of it? thanks!

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    One solution is FindItem() and LVFINDINFO structure.

    Kuphryn

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Lookup the LB_FINDSTRING message...use it with SendMessage. Pass -1 for wParam and cast the string to find for lParam.

    If the return is LB_ERR, then the string isnt in there and you can add it

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compile Error that i dont understand
    By bobthebullet990 in forum C++ Programming
    Replies: 5
    Last Post: 05-05-2006, 09:19 AM
  2. Need help on String Searching.
    By RP319 in forum C++ Programming
    Replies: 3
    Last Post: 11-21-2005, 09:33 PM
  3. Visual C++ 2005 linking and file sizes
    By Rune Hunter in forum C++ Programming
    Replies: 2
    Last Post: 11-12-2005, 09:41 PM
  4. can anyone see anything wrong with this code
    By occ0708 in forum C++ Programming
    Replies: 6
    Last Post: 12-07-2004, 11:47 AM
  5. Linked List Help
    By CJ7Mudrover in forum C Programming
    Replies: 9
    Last Post: 03-10-2004, 09:33 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21