I have created a dialog-based app that has an icon in the system tray, however, the menu for the icon doesn't function properly. It looks as though it should, the resource file has all of the menu items enabled and I am pretty sure I loaded the menu correctly:
CMenu* pSubMenu = menu.GetSubMenu(0);
Then later, after receiving a WM_RBUTTONUP message I do the tracking of the menu:
::SetMenuDefaultItem(pSubMenu->m_hMenu, 0, TRUE);
::TrackPopupMenu(pSubMenu->m_hMenu, 0, p.x, p.y, 0, m_Icon.hWnd, NULL);
The problem is that when the menu pops up, all of the menu items are grayed and disabled. I think it is probably something small that I am just missing, any help would be appreciated.