summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src/msgs.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-05-15 13:10:05 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-05-15 13:10:05 +0000
commit1b24cfc81b5ed2f2cfaf6d30135002d8f1ef8814 (patch)
treea53c16e7328567745a1a4204ffe5f4c4eaa35086 /plugins/TabSRMM/src/msgs.cpp
parent27400e5eb7906bdcf8bb46e9014a37febcd4c097 (diff)
fix for tabSRMM sessions processing
git-svn-id: http://svn.miranda-ng.org/main/trunk@4660 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/src/msgs.cpp')
-rw-r--r--plugins/TabSRMM/src/msgs.cpp20
1 files 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;
}