From 1b24cfc81b5ed2f2cfaf6d30135002d8f1ef8814 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 15 May 2013 13:10:05 +0000 Subject: fix for tabSRMM sessions processing git-svn-id: http://svn.miranda-ng.org/main/trunk@4660 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/msgs.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 00e1ea6f64..6d7de7f81f 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -137,15 +137,21 @@ static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam) static INT_PTR SetStatusText(WPARAM wParam, LPARAM lParam) { - HWND hwnd = M->FindWindow((HANDLE)wParam); - if (hwnd == NULL) - return 1; + TContainerData *pContainer; - TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwnd, GWLP_USERDATA); - if (dat == NULL || dat->pContainer == NULL) - return 1; + HWND hwnd = M->FindWindow((HANDLE)wParam); + if (hwnd != NULL) { + TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwnd, GWLP_USERDATA); + if (dat == NULL || (pContainer = dat->pContainer) == NULL) + return 1; + } + else { + SESSION_INFO *si = SM_FindSessionByHCONTACT((HANDLE)wParam); + if (si == NULL || si->hWnd == 0 || (pContainer = si->pContainer) == NULL) + return 1; + } - SendMessage(dat->pContainer->hwndStatus, SB_SETTEXT, 0, lParam); + SendMessage(pContainer->hwndStatus, SB_SETTEXT, 0, lParam); return 0; } -- cgit v1.2.3