void CTeenSpiritDlg::ShowTrayMenu(CPoint& pt) { PrgAPI* pAPI = PRGAPI(); MenuManager* pMM = pAPI->GetMenuManager(); ITSMenu& trayMenu = pMM->GetMenu(MenuManager::MNU_Tray); pMM->PrepareMenu(MenuManager::MNU_Tray); pMM->PreparePlayerCommands(*pAPI->GetMediaPlayer()); //=== This handling is done because otherwise the menu will not disappear when the user clicks outside SetForegroundWindow(); trayMenu.TrackPopupMenu(pt.x, pt.y, GetSafeHwnd()); PostMessage(WM_NULL, 0, 0); }
ITSMenu* WebPane::GetMenu(UINT idx) { switch (idx) { case BTN_Options: { PrgAPI* pAPI = PRGAPI(); //MediaPlayer* pPlayer = pAPI->GetMediaPlayer(); MenuManager* pMM = pAPI->GetMenuManager(); //MenuCommandsEnum cmd = (MenuCommandsEnum) idx; ITSMenu& mnu = GetInternalMenu(M_Main); //pMM->ResetServicesMenu PlayerCommands(*pPlayer); //mnu.CheckMenuItem(MI_ShowNumbers, m_PlayList.GetConfigurationOption(CPlayListListCtrl::C_ShowNumbers) != 0); pMM->PrepareMenu(MenuManager::MNU_ArtistServices); pMM->PrepareMenu(MenuManager::MNU_AlbumServices); pMM->PrepareMenu(MenuManager::MNU_TrackServices); if (m_SyncWithArtistService > -1) mnu.CheckMenuItem(MENU_WebServicesHolder + m_SyncWithArtistService, TRUE); if (m_SyncWithAlbumService > -1) mnu.CheckMenuItem(MENU_WebServicesHolder + m_SyncWithAlbumService, TRUE); if (m_SyncWithTrackService > -1) mnu.CheckMenuItem(MENU_WebServicesHolder + m_SyncWithTrackService, TRUE); mnu.CheckMenuItem(MI_SyncWithPlayer, m_bSyncWithPlayer); mnu.CheckMenuItem(MI_SyncWithSectionChanger, m_bSyncWithSectionsChanger); mnu.CheckMenuItem(MI_SyncWithTracksChanger, m_bSyncWithTracksChanger); ServicesRegistrationSrv::IWebViewer* pViewer = pAPI->GetServicesRegistrationSrv()->GetWebViewer(); mnu.CheckMenuItem(MI_UseAsWebViewer, pViewer == this); return &mnu; } break; default: return NULL; } return NULL; }