Click to See Complete Forum and Search --> : OnContextMenu ain't being called


Jaime Wyant
May 24th, 1999, 11:04 AM
I have

class CMyTreeCtrl : CTreeCtrl

Which I need to display Right-Click popup menus. However my OnContextMenu() handler is not being called when I right-click in the tree control.

Can anyone tell me why this handler is not being called? I can get my menu to popup by catching Right-button down events, but it aint working just right.

Shouldn't the popup menu be displayed from within OnContextMenu()?

Thanks,
Jaime

ShengTian Liao
May 25th, 1999, 08:23 AM
WM_CONTEXTMENU message is generate from WM_RBUTTONDOWN and WM_RBUTTONUP. Sometimes, the WM_RBUTTONUP message may not send to the control in a dialog box, so you may need to process the WM_CONTEXTMENU in the dialog box window.

1st