From 97d55ca3bede2281dc5b615fb9755195963aa83b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 6 Dec 2016 23:12:21 +0300 Subject: forgotten code for processing toolbar button events --- src/core/stdmsg/src/chat_window.cpp | 10 ++++++++++ src/core/stdmsg/src/msgdialog.cpp | 2 +- src/core/stdmsg/src/stdafx.h | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp index 6bfa86272b..453b979a3a 100644 --- a/src/core/stdmsg/src/chat_window.cpp +++ b/src/core/stdmsg/src/chat_window.cpp @@ -1145,6 +1145,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar SendMessage(hwndButton, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIconByHandle(cbd->m_hIcon)); } + NotifyLocalWinEvent(si->hContact, hwndDlg, MSG_WINDOW_EVT_OPENING); mir_subclassWindow(GetDlgItem(hwndDlg, IDC_SPLITTERX), SplitterSubclassProc); mir_subclassWindow(GetDlgItem(hwndDlg, IDC_SPLITTERY), SplitterSubclassProc); mir_subclassWindow(hNickList, NicklistSubclassProc); @@ -1187,6 +1188,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar SendMessage(hwndDlg, GC_UPDATETITLE, 0, 0); SendMessage(hwndDlg, GC_SETWINDOWPOS, 0, 0); } + NotifyLocalWinEvent(si->hContact, hwndDlg, MSG_WINDOW_EVT_OPEN); break; case GC_SETWNDPROPS: @@ -2251,6 +2253,12 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar break; case WM_COMMAND: + if (HIWORD(wParam) == BN_CLICKED) + if (LOWORD(wParam) >= MIN_CBUTTONID && LOWORD(wParam) <= MAX_CBUTTONID) { + Srmm_ClickToolbarIcon(si->hContact, LOWORD(wParam), GetDlgItem(hwndDlg, LOWORD(wParam)), 0); + break; + } + switch (LOWORD(wParam)) { case IDC_LIST: if (HIWORD(wParam) == LBN_DBLCLK) { @@ -2484,6 +2492,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar break; case WM_DESTROY: + NotifyLocalWinEvent(si->hContact, hwndDlg, MSG_WINDOW_EVT_CLOSING); SendMessage(hwndDlg, GC_SAVEWNDPOS, 0, 0); si->hWnd = NULL; @@ -2492,6 +2501,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar si->hwndStatus = NULL; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0); + NotifyLocalWinEvent(si->hContact, hwndDlg, MSG_WINDOW_EVT_CLOSE); break; } return FALSE; diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index da30d9a647..65ab69b1b2 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -36,7 +36,7 @@ static void UpdateReadChars(HWND hwndDlg, HWND hwndStatus); static const UINT infoLineControls[] = { IDC_PROTOCOL, IDC_NAME }; static const UINT sendControls[] = { IDC_MESSAGE }; -static void NotifyLocalWinEvent(MCONTACT hContact, HWND hwnd, unsigned int type) +void NotifyLocalWinEvent(MCONTACT hContact, HWND hwnd, unsigned int type) { if (hContact != NULL && hwnd != NULL) { MessageWindowEventData mwe = { 0 }; diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h index 8b3c9e400c..5ad3eaaf4a 100644 --- a/src/core/stdmsg/src/stdafx.h +++ b/src/core/stdmsg/src/stdafx.h @@ -159,6 +159,7 @@ bool LoadMessageFont(LOGFONT *lf, COLORREF *colour); // message.c char* Message_GetFromStream(HWND hwndDlg, SESSION_INFO *si); +void NotifyLocalWinEvent(MCONTACT hContact, HWND hwnd, unsigned int type); BOOL TabM_AddTab(const wchar_t *pszID, const char* pszModule); BOOL TabM_RemoveAll(void); -- cgit v1.2.3