From abf4069c2e3473da8f1d468e46c19951935a912f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 14 Mar 2017 12:19:39 +0300 Subject: fixes #744 --- plugins/TabSRMM/src/msgs.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'plugins/TabSRMM/src/msgs.cpp') diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 9049314a48..cd5e765b0c 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -835,33 +835,27 @@ void TSAPI CreateImageList(BOOL bInitial) PluginConfig.g_IconTypingEvent = PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING]; } -int TABSRMM_FireEvent(MCONTACT hContact, HWND hwnd, unsigned int type, unsigned int subType) +int CTabBaseDlg::FireEvent(unsigned int type, unsigned int subType) { - if (hContact == 0 || hwnd == nullptr) + if (m_hContact == 0 || m_hwnd == nullptr) return 0; - CSrmmWindow *dat = (CSrmmWindow*)GetWindowLongPtr(hwnd, GWLP_USERDATA); + CSrmmWindow *dat = (CSrmmWindow*)GetWindowLongPtr(m_hwnd, GWLP_USERDATA); if (dat == nullptr) return 0; MessageWindowEventData mwe = { sizeof(mwe) }; - mwe.hContact = hContact; - mwe.hwndWindow = hwnd; + mwe.hContact = m_hContact; + mwe.hwndWindow = m_hwnd; mwe.szModule = "tabSRMsgW"; mwe.uType = type; - if (!dat->isChat()) { - mwe.hwndInput = GetDlgItem(hwnd, IDC_MESSAGE); - mwe.hwndLog = GetDlgItem(hwnd, IDC_LOG); - } - else { - mwe.hwndInput = GetDlgItem(hwnd, IDC_MESSAGE); - mwe.hwndLog = GetDlgItem(hwnd, IDC_LOG); - } + mwe.hwndInput = m_message.GetHwnd(); + mwe.hwndLog = m_log.GetHwnd(); if (type == MSG_WINDOW_EVT_CUSTOM) { TABSRMM_SessionInfo se = { sizeof(se) }; se.evtCode = HIWORD(subType); - se.hwnd = hwnd; + se.hwnd = m_hwnd; se.extraFlags = (unsigned int)(LOWORD(subType)); se.local = dat->m_sendBuffer; mwe.local = &se; -- cgit v1.2.3