Jump to content
  • Advertisement
Sign in to follow this  
ostamo1

win 32 list box

This topic is 5136 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
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.

Share this post


Link to post
Share on other sites
can u please give me an example
i would really appreciate it.
and i thank you for answering ALL my newbie questions lately

Share this post


Link to post
Share on other sites

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, ...);

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
that was so easy it makes me pissed off i could not figure that out

oh well thanks a whole bunch for your help

and also your project looks cool


Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by ostamo1
and also your project looks cool


Thanks :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!