From 45a5b1f9b7709f8d93b57abea7ba46b44eac5707 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 10 Oct 2013 15:13:20 +0000 Subject: - MS_CLIST_GETSTATUSMODEDESCRIPTION replaced with the direct clist call - crazy & obsolete constant GSMDF_PREFIXONLINE removed git-svn-id: http://svn.miranda-ng.org/main/trunk@6428 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_nicer/src/statusbar.cpp | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'plugins/Clist_nicer/src/statusbar.cpp') diff --git a/plugins/Clist_nicer/src/statusbar.cpp b/plugins/Clist_nicer/src/statusbar.cpp index 98ac8c008e..33014a64f7 100644 --- a/plugins/Clist_nicer/src/statusbar.cpp +++ b/plugins/Clist_nicer/src/statusbar.cpp @@ -152,25 +152,24 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM for (int i = 0; i < nParts; i++) { RECT rc; SendMessage(hwnd, SB_GETRECT, i, (LPARAM)&rc); - if (PtInRect(&rc,pt)) { + if ( PtInRect(&rc,pt)) { ProtocolData *PD = (ProtocolData *)SendMessageA(hwnd, SB_GETTEXTA, i, 0); - if (PD) { - if (NotifyEventHooks(hStatusBarShowToolTipEvent, (WPARAM)PD->RealName, 0) > 0) // a plugin handled this event - tooltip_active = TRUE; - else if (cfg::getDword("mToolTip", "ShowStatusTip", 0)) { - CLCINFOTIP ti = {0}; - BYTE isLocked = 0; - char szTipText[256], *szStatus = NULL; - WORD wStatus; - - ti.cbSize = sizeof(ti); - ti.isTreeFocused = GetFocus() == pcli->hwndContactList ? 1 : 0; - wStatus = (WORD)CallProtoService(PD->RealName, PS_GETSTATUS, 0, 0); - isLocked = cfg::getByte(PD->RealName, "LockMainStatus", 0); - szStatus = (char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)wStatus, 0); - mir_snprintf(szTipText, 256, "%s: %s%s", PD->RealName, szStatus, isLocked ? " (LOCKED)" : ""); - CallService("mToolTip/ShowTip", (WPARAM)szTipText, (LPARAM)&ti); - } + if (PD == NULL) + continue; + + if (NotifyEventHooks(hStatusBarShowToolTipEvent, (WPARAM)PD->RealName, 0) > 0) // a plugin handled this event + tooltip_active = TRUE; + else if (cfg::getDword("mToolTip", "ShowStatusTip", 0)) { + WORD wStatus = (WORD)CallProtoService(PD->RealName, PS_GETSTATUS, 0, 0); + BYTE isLocked = cfg::getByte(PD->RealName, "LockMainStatus", 0); + + TCHAR szTipText[256]; + mir_sntprintf(szTipText, SIZEOF(szTipText), _T("%s: %s%s"), + PD->RealName, pcli->pfnGetStatusModeDescription(wStatus, 0), isLocked ? _T(" (LOCKED)") : _T("")); + + CLCINFOTIP ti = { sizeof(ti) }; + ti.isTreeFocused = (GetFocus() == pcli->hwndContactList); + CallService("mToolTip/ShowTipW", (WPARAM)szTipText, (LPARAM)&ti); } break; } -- cgit v1.2.3