bithub your suggestion works perfect. Thanks a million.
Code:
CRect rect;
m_lstLayers.GetWindowRect(&rect);
if (PtInRect(&rect,point))
{
CMenu *temp=RMenu->GetSubMenu(0);
temp->TrackPopupMenu(TPM_LEFTALIGN | TPM_TOPALIGN,point.x,point.y,this);
}
I can't use the CWnd pointer because that would infer that all my child windows have right click menus and they don't. So I use this as a handler for all the different windows that do have right click menus. It works like a charm. I'm adding code to the CPropertyPage class to support greyed out popup menu items. When I get this done, I'll use that as the base class for my property pages instead of CPropertyPage.
Thanks a million.
Here is an update screenshot. You'll notice that I've de-cluttered the desktop by sticking most of the windows in a CPropertySheet.