diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index 1f83fca..e1f3dfd 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -257,7 +257,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) p->szAccountName = mir_strdup(szProto); p->szProtoName = mir_strdup(accs[i]->szProtoName); p->tszProtoStatusText = mir_tstrdup(pcli->pfnGetStatusModeDescription(p->iProtoStatus, 0)); - p->iProtoPos = ProtosData.getCount(); + p->iProtoPos = j; p->bIsDimmed = 0; if (g_CluiData.bFilterEffective & CLVM_FILTER_PROTOS) { @@ -812,7 +812,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa BOOL bShift = (GetKeyState(VK_SHIFT) & 0x8000); BOOL bCtrl = (GetKeyState(VK_CONTROL) & 0x8000); - if ((msg == WM_MBUTTONDOWN || (msg == WM_RBUTTONDOWN && bCtrl) || isOnExtra) && _ModernStatus_OnExtraIconClick(i)) + if ((msg == WM_MBUTTONDOWN || (msg == WM_RBUTTONDOWN && bCtrl) || isOnExtra) && _ModernStatus_OnExtraIconClick(p.iProtoPos)) return TRUE; if (msg == WM_LBUTTONDOWN && bCtrl) { @@ -888,15 +888,9 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa } else { hMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0); - unsigned int cpnl = 0; - int mcnt = GetMenuItemCount(hMenu); - for (int j = 0; j < mcnt; ++j) { - HMENU hMenus = GetSubMenu(hMenu, j); - if (hMenus && cpnl++ == i) { - hMenu = hMenus; - break; - } - } + HMENU hSubMenu = GetSubMenu(hMenu, p.iProtoPos); + if (hSubMenu) + hMenu = hSubMenu; } }