MIR_APP_DLL(HMENU) Menu_BuildTrayMenu(void) { NotifyEventHooks(hEventPreBuildTrayMenu, 0, 0); HMENU hMenu = CreatePopupMenu(); Menu_Build(hMenu, hTrayMenuObject); return hMenu; }
static INT_PTR BuildContextFrameMenu(WPARAM wParam, LPARAM lParam) { ContextFrameMenuNotify(wParam, -1); HMENU hMenu = CreatePopupMenu(); Menu_Build(hMenu, hFrameMenuObject, wParam, lParam); return (INT_PTR)hMenu; }
MIR_APP_DLL(HMENU) Menu_BuildSubGroupMenu(ClcGroup *group) { NotifyEventHooks(hEventPreBuildSubGroupMenu, (WPARAM)group, 0); HMENU hMenu = CreatePopupMenu(); Menu_Build(hMenu, hSubGroupMenuObject, (WPARAM)group, 0); return hMenu; }
void ShowOTRMenu(MCONTACT hContact, POINT pt) { HMENU hMenu = CreatePopupMenu(); Menu_Build(hMenu, hMirOTRMenuObject, hContact); SetWindowLongPtr(hDummyPaintWin, GWLP_USERDATA, (LONG_PTR)hContact); TrackPopupMenu(hMenu, 0, pt.x, pt.y, 0, hDummyPaintWin, 0); DestroyMenu(hMenu); }
CJabberProto* JabberChooseInstance(bool bIsLink) { if (g_Instances.getCount() == 0) return NULL; if (g_Instances.getCount() == 1) { if (g_Instances[0]->m_iStatus != ID_STATUS_OFFLINE && g_Instances[0]->m_iStatus != ID_STATUS_CONNECTING) return g_Instances[0]; return NULL; } if (bIsLink) for (int i = 0; i < g_Instances.getCount(); i++) if (g_Instances[i]->m_options.ProcessXMPPLinks) return g_Instances[i]; int nItems = 0, lastItemId = 0; for (int i = 0; i < g_Instances.getCount(); i++) { CJabberProto *ppro = g_Instances[i]; if (ppro->m_iStatus != ID_STATUS_OFFLINE && ppro->m_iStatus != ID_STATUS_CONNECTING) { ++nItems; lastItemId = i + 1; Menu_ModifyItem(ppro->m_hChooseMenuItem, NULL, Skin_LoadProtoIcon(ppro->m_szModuleName, ppro->m_iStatus)); } else Menu_ShowItem(ppro->m_hChooseMenuItem, false); } if (nItems > 1) { POINT pt; GetCursorPos(&pt); HMENU hMenu = CreatePopupMenu(); Menu_Build(hMenu, hChooserMenu); int res = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, pcli->hwndContactList, NULL); DestroyMenu(hMenu); if (res) { CJabberProto* pro = NULL; Menu_ProcessCommandById(res, (LPARAM)&pro); return pro; } return NULL; } return lastItemId ? g_Instances[lastItemId - 1] : NULL; }