diff options
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r-- | plugins/TabSRMM/src/msgs.cpp | 20 |
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;
}
|