From 6f7e22b45b07f125320129fa3619d786bfebe87e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 15 May 2013 13:04:57 +0000 Subject: MS_MSG_SETSTATUSTEXT for Scriver git-svn-id: http://svn.miranda-ng.org/main/trunk@4658 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Scriver/src/msgs.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index 97ba638b7e..3e775f2ac6 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -322,13 +322,13 @@ static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam) { MessageWindowInputData *mwid = (MessageWindowInputData*)wParam; MessageWindowData *mwd = (MessageWindowData*)lParam; - HWND hwnd; if (mwid == NULL || mwd == NULL) return 1; if (mwid->cbSize != sizeof(MessageWindowInputData) || mwd->cbSize != sizeof(SrmmWindowData)) return 1; if (mwid->hContact == NULL) return 1; if (mwid->uFlags != MSG_WINDOW_UFLAG_MSG_BOTH) return 1; - hwnd = WindowList_Find(g_dat.hMessageWindowList, mwid->hContact); + + HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, mwid->hContact); if (hwnd == NULL) hwnd = SM_FindWindowByContact(mwid->hContact); mwd->uFlags = MSG_WINDOW_UFLAG_MSG_BOTH; @@ -338,6 +338,22 @@ static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam) return 0; } +static INT_PTR SetStatusText(WPARAM wParam, LPARAM lParam) +{ + HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, (HANDLE)wParam); + if (hwnd == NULL) + hwnd = SM_FindWindowByContact((HANDLE)wParam); + if (hwnd == NULL) + return 1; + + SrmmWindowData *dat = (SrmmWindowData*)GetWindowLongPtr(hwnd, GWLP_USERDATA); + if (dat == NULL || dat->parent == NULL) + return 1; + + SendMessage(dat->parent->hwndStatus, SB_SETTEXT, 0, lParam); + return 0; +} + static int PrebuildContactMenu(WPARAM wParam, LPARAM lParam) { HANDLE hContact = (HANDLE)wParam; @@ -531,6 +547,7 @@ int OnLoadModule(void) CreateServiceFunction(MS_MSG_GETWINDOWAPI, GetWindowAPI); CreateServiceFunction(MS_MSG_GETWINDOWCLASS, GetWindowClass); CreateServiceFunction(MS_MSG_GETWINDOWDATA, GetWindowData); + CreateServiceFunction(MS_MSG_SETSTATUSTEXT, SetStatusText); CreateServiceFunction("SRMsg/ReadMessage", ReadMessageCommand); CreateServiceFunction("SRMsg/TypingMessage", TypingMessageCommand); -- cgit v1.2.3