Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listview trouble 1

Status
Not open for further replies.

MKuiper

Programmer
Jan 29, 2002
364
0
0
NL
I am trying to add a context menu to a listview. Right-clicking the listview should let the context menu appear. This part works ok.

Problem is, when i right-click in the listview (full row select), the line containing the mouse-arrow is selected, causing all previously selected lines to be deselected. This all happens before the right-click notification is sent.
I would like this behaviour to be suppressed (right-clicking should not do anything with the selection), because the context menu contains functions which should be performed on all selected items. Possible? If yes, how?


Marcel
 
Subclass the control and handlw WM_RBUTTONDOWN

If you want the "normal" behavior then call the original list view WindowProc (NOT DefWindowProc).

I REALLY hope this helps.
Will
 
Will,

This seems the way to go. Thank you, one more star for you.

Marcel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top