Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

aboeing

listbox notify

This topic is 5601 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

hi i just wanted to know how to know when someone right clicks in a listbox control. im using win32 and as far as i can see there only seems to be a LBN_DBLCLK notification... (i want to display a pop-up menu when this happens..) cheerz

Share this post


Link to post
Share on other sites
Advertisement
figured it out, just using the WM_CONTEXTMENU message to get all right clicks and then testing if the mouse position is within the controls rectange (GetWindowRect( hwt, &pos)

ive actually got another problem, in that the list box contains a fair number of items, however i want to refresh this information every second or so, and clearing the listbox and re-adding the items is highly annoying, is there a better way to do this? (can you simply replace the existing text for an item somehow?)

cheers

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
try sending the listbox a WM_SETREDRAW with FALSE, then do the clearing/re-adding, then send another WM_SETREDRAW with TRUE, then invalidate the window to force it to redraw.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
also, to speed up the refresh, instead of clearing/re-adding, just do a LB_DELETESTRING followed by a LB_INSERTSTRING for the item(s) that change.

Share this post


Link to post
Share on other sites

  • 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!