Thread: Getting selected item in ListBox?

  1. #1
    BubbleMan
    Guest

    Question Getting selected item in ListBox?

    Ok, I know how to use WM_RBUTTONDOWN, and how to put strings in a MessageBox. How would I get the selected item in a ListBox and put it into a char?

  2. #2
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    You do it in the same way as putting strings in the list box. You send LB_GETCURSEL message to your list box to obtain the index. You can then use this index entry in a LB_GETTEXT message to get the string if you need it. Check this link for details.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Immediate programming help! Please!
    By xMEGANx in forum C++ Programming
    Replies: 6
    Last Post: 02-20-2008, 12:52 PM
  2. Retail Outlet Managment System - the 4th
    By Presidentofusa in forum C Programming
    Replies: 3
    Last Post: 11-10-2007, 10:44 PM
  3. Constructive Feed Back (Java Program)
    By xddxogm3 in forum Tech Board
    Replies: 12
    Last Post: 10-10-2004, 04:41 AM
  4. How to cast a ListBox item to an int for a switch statment?
    By Swaine777 in forum C++ Programming
    Replies: 8
    Last Post: 09-26-2004, 09:52 PM
  5. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 01:04 PM
Website Security Test