win 32 list box
is this what i use to get information from a list box??
i have a list box with 3 names in it
i want to finds out what name is selected and change some varibles dependent on the names
like age
favored food
and such
how do i find out which name was selected
i tried reading msdn but it just is confuing me more
thanks for your help
No, this does not return the actual text. It is used when you have data to store for each item in an owner-drawn listbox.
Use LB_GETCURSEL to find the zero-based index of the selection. If you don't have it stored elsewhere, use LB_GETTEXT to retrieve the item text.
Use LB_GETCURSEL to find the zero-based index of the selection. If you don't have it stored elsewhere, use LB_GETTEXT to retrieve the item text.
can u please give me an example
i would really appreciate it.
and i thank you for answering ALL my newbie questions lately
i would really appreciate it.
and i thank you for answering ALL my newbie questions lately
int itemID = (int) SendMessage(hwListBox, LB_GETCURSEL, 0,0);char text[256];SendMessage(hwListBox, LB_GETTEXT, itemID, (LPARAM) text);
If it's in a dialog box use SendDlgItemMessage(hwDialog, ID_LISTBOX, ...);
thanks i really appreciate all the help you have given me
but learning the win 32 api is fifficult and there are not to many tutorials out there that explain things goos enough
(like what to pass into the functions)
so thanks again for all your help
but learning the win 32 api is fifficult and there are not to many tutorials out there that explain things goos enough
(like what to pass into the functions)
so thanks again for all your help
Hey, we've all been there :)
When I first started with win32 I couldn't figure out how to process WM_CLOSE properly (it would just hang) so I had all my programs set up so you would double-click to exit them. Changing exactly 1 line fixed it, but it took me ages to figure out.
When I first started with win32 I couldn't figure out how to process WM_CLOSE properly (it would just hang) so I had all my programs set up so you would double-click to exit them. Changing exactly 1 line fixed it, but it took me ages to figure out.
hey is thereany way i can return a negative number to an edit box
or static box and show it in the window instead of 4929blah
i would like it to say -1 or -2
or static box and show it in the window instead of 4929blah
i would like it to say -1 or -2
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement