listbox notify
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
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
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
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement