Getting selected item in ListBox?

This is a discussion on Getting selected item in ListBox? within the Windows Programming forums, part of the Platform Specific Boards category; Ok, I know how to use WM_RBUTTONDOWN, and how to put strings in a MessageBox. How would I get the ...

  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
    zen
    zen is offline
    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

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