Detecting CListBox (Mouse) events
Posted on 2001-07-19
I have a CListbox on a property page, which I converted
to a draglistbox by overriding the member variable so
that its a CDragListBox type. When you double click on
an item in the listbox a dialog box appears, different
one each time depending on the item selected. I called
the listbox class CMyListBox.
Then to use the CDragListBox member functions, e.g.,
Dropped() I subclassed CMyListBox to CDragList. I then
added in the Dropped() function in CDragList, which
works fine. But now when I double click on an entry in
my listbox it goes straight into the Dropped() function
and the dialog box associated with the entry in the
listbox doesn't appear. I assume this is because when
you double click on an item in the listbox, after
the first click is detected it goes into Dropped(), so
the second click is never registered and OnDblClk() in
CMyListBox is never called.
How can I make my application distinguish between a
single click (when perform drag and drop) and a double
click when wanting to display the associated dialog box.
I tried to put in a call in the Dropped() function in
my subclass to OnDblClk() in CMyListBox? like
// Do some stuff
but it failed, said that I couldn't call a protected
member function. Whats the right way to do this?