From 6a9e3738066370dac38f5f6768b8a6f61fe709e0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 28 Mar 2017 14:18:31 +0300 Subject: SRMM notifications went to the core with ME_MSG_WINDOWEVENT --- plugins/Scriver/src/chat_window.cpp | 8 ++--- plugins/Scriver/src/msgdialog.cpp | 24 +++------------ plugins/Scriver/src/msgs.cpp | 54 ++++++++++++++++++++++++++++++-- plugins/Scriver/src/msgs.h | 2 ++ plugins/Scriver/src/stdafx.h | 2 +- plugins/Scriver/src/tabs.cpp | 61 +++++-------------------------------- plugins/Scriver/src/tabs.h | 3 +- plugins/TabSRMM/src/chat_window.cpp | 15 +++++---- plugins/TabSRMM/src/globals.cpp | 5 +-- plugins/TabSRMM/src/globals.h | 2 +- plugins/TabSRMM/src/msgdialog.cpp | 14 +++------ plugins/TabSRMM/src/msgs.cpp | 30 ------------------ plugins/TabSRMM/src/msgs.h | 12 -------- 13 files changed, 83 insertions(+), 149 deletions(-) (limited to 'plugins') diff --git a/plugins/Scriver/src/chat_window.cpp b/plugins/Scriver/src/chat_window.cpp index d431f6a89b..970d78429a 100644 --- a/plugins/Scriver/src/chat_window.cpp +++ b/plugins/Scriver/src/chat_window.cpp @@ -211,7 +211,7 @@ void CChatRoomDlg::OnInitDialog() CSuper::OnInitDialog(); m_si->pDlg = this; - NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_OPENING); + NotifyEvent(MSG_WINDOW_EVT_OPENING); SetWindowLongPtr(m_hwnd, GWLP_USERDATA, (LONG_PTR)this); m_pParent = (ParentWindowData *)GetWindowLongPtr(m_hwndParent, GWLP_USERDATA); @@ -265,12 +265,12 @@ void CChatRoomDlg::OnInitDialog() SendMessage(m_hwndParent, CM_ADDCHILD, (WPARAM)this, 0); UpdateNickList(); - NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_OPEN); + NotifyEvent(MSG_WINDOW_EVT_OPEN); } void CChatRoomDlg::OnDestroy() { - NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_CLOSING); + NotifyEvent(MSG_WINDOW_EVT_CLOSING); m_si->pDlg = nullptr; SetWindowLongPtr(m_hwnd, GWLP_USERDATA, 0); @@ -284,7 +284,7 @@ void CChatRoomDlg::OnDestroy() CallService(MS_IEVIEW_WINDOW, 0, (LPARAM)&ieWindow); } - NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_CLOSE); + NotifyEvent(MSG_WINDOW_EVT_CLOSE); CSuper::OnDestroy(); } diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index e1e2e7525a..a798d00868 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -91,22 +91,6 @@ static wchar_t* GetQuotedTextW(wchar_t *text) return out; } -void NotifyLocalWinEvent(MCONTACT hContact, HWND hwnd, unsigned int type) -{ - if (hContact == 0 || hwnd == nullptr) - return; - - MessageWindowEventData mwe = { sizeof(mwe) }; - mwe.hContact = hContact; - mwe.hwndWindow = hwnd; - mwe.szModule = SRMM_MODULE; - mwe.uType = type; - mwe.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH; - mwe.hwndInput = GetDlgItem(hwnd, IDC_SRMM_MESSAGE); - mwe.hwndLog = GetDlgItem(hwnd, IDC_SRMM_LOG); - NotifyEventHooks(hHookWinEvt, 0, (LPARAM)&mwe); -} - int RTL_Detect(WCHAR *pszwText) { size_t iLen = mir_wstrlen(pszwText); @@ -220,7 +204,7 @@ void CSrmmWindow::OnInitDialog() SetWindowLongPtr(m_hwnd, GWLP_USERDATA, (LONG_PTR)this); WindowList_Add(pci->hWindowList, m_hwnd, m_hContact); - NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_OPENING); + NotifyEvent(MSG_WINDOW_EVT_OPENING); m_pParent = (ParentWindowData *)GetWindowLongPtr(m_hwndParent, GWLP_USERDATA); m_szProto = GetContactProto(m_hContact); @@ -413,12 +397,12 @@ void CSrmmWindow::OnInitDialog() if (m_iMessagesInProgress > 0) SendMessage(m_hwnd, DM_SHOWMESSAGESENDING, 0, 0); - NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_OPEN); + NotifyEvent(MSG_WINDOW_EVT_OPEN); } void CSrmmWindow::OnDestroy() { - NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_CLOSING); + NotifyEvent(MSG_WINDOW_EVT_CLOSING); if (m_nTypeMode == PROTOTYPE_SELFTYPING_ON) NotifyTyping(PROTOTYPE_SELFTYPING_OFF); @@ -459,7 +443,7 @@ void CSrmmWindow::OnDestroy() ieWindow.hwnd = m_hwndIeview; CallService(MS_IEVIEW_WINDOW, 0, (LPARAM)&ieWindow); } - NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_CLOSE); + NotifyEvent(MSG_WINDOW_EVT_CLOSE); CSuper::OnDestroy(); } diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index 90f5c36252..b6478dc16b 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" HCURSOR hDragCursor; -HANDLE hHookWinEvt, hHookWinPopup, hHookWinWrite; +HANDLE hHookWinPopup, hHookWinWrite; HGENMENU hMsgMenuItem; HMODULE hMsftEdit; @@ -376,6 +376,56 @@ void CScriverWindow::LoadSettings() LoadMsgDlgFont(MSGFONTID_MESSAGEAREA, nullptr, &m_clrInputFG); } +void CScriverWindow::Reattach(HWND hwndContainer) +{ + MCONTACT hContact = m_hContact; + + POINT pt; + GetCursorPos(&pt); + HWND hParent = WindowFromPoint(pt); + while (GetParent(hParent) != nullptr) + hParent = GetParent(hParent); + + hParent = WindowList_Find(g_dat.hParentWindowList, (UINT_PTR)hParent); + if ((hParent != nullptr && hParent != hwndContainer) || (hParent == nullptr && m_pParent->childrenCount > 1 && (GetKeyState(VK_CONTROL) & 0x8000))) { + if (hParent == nullptr) { + hParent = GetParentWindow(hContact, FALSE); + + RECT rc; + GetWindowRect(hParent, &rc); + + rc.right = (rc.right - rc.left); + rc.bottom = (rc.bottom - rc.top); + rc.left = pt.x - rc.right / 2; + rc.top = pt.y - rc.bottom / 2; + HMONITOR hMonitor = MonitorFromRect(&rc, MONITOR_DEFAULTTONEAREST); + + MONITORINFO mi; + mi.cbSize = sizeof(mi); + GetMonitorInfo(hMonitor, &mi); + + RECT rcDesktop = mi.rcWork; + if (rc.left < rcDesktop.left) + rc.left = rcDesktop.left; + if (rc.top < rcDesktop.top) + rc.top = rcDesktop.top; + MoveWindow(hParent, rc.left, rc.top, rc.right, rc.bottom, FALSE); + } + NotifyEvent(MSG_WINDOW_EVT_CLOSING); + NotifyEvent(MSG_WINDOW_EVT_CLOSE); + SetParent(hParent); + SendMessage(hwndContainer, CM_REMOVECHILD, 0, (LPARAM)m_hwnd); + SendMessage(m_hwnd, DM_SETPARENT, 0, (LPARAM)hParent); + SendMessage(hParent, CM_ADDCHILD, (WPARAM)this, 0); + SendMessage(m_hwnd, DM_UPDATETABCONTROL, 0, 0); + SendMessage(hParent, CM_ACTIVATECHILD, 0, (LPARAM)m_hwnd); + NotifyEvent(MSG_WINDOW_EVT_OPENING); + NotifyEvent(MSG_WINDOW_EVT_OPEN); + ShowWindow(hParent, SW_SHOWNA); + EnableWindow(hParent, TRUE); + } +} + ///////////////////////////////////////////////////////////////////////////////////////// // status icons processing @@ -592,7 +642,6 @@ int OnUnloadModule(void) { DestroyCursor(hDragCursor); - DestroyHookableEvent(hHookWinEvt); DestroyHookableEvent(hHookWinPopup); DestroyHookableEvent(hHookWinWrite); @@ -639,7 +688,6 @@ int OnLoadModule(void) CreateServiceFunction("SRMsg/ReadMessage", ReadMessageCommand); CreateServiceFunction("SRMsg/TypingMessage", TypingMessageCommand); - hHookWinEvt = CreateHookableEvent(ME_MSG_WINDOWEVENT); hHookWinPopup = CreateHookableEvent(ME_MSG_WINDOWPOPUP); hHookWinWrite = CreateHookableEvent(ME_MSG_PRECREATEEVENT); diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h index 58c80d4d6a..935fdaa1dc 100644 --- a/plugins/Scriver/src/msgs.h +++ b/plugins/Scriver/src/msgs.h @@ -98,6 +98,8 @@ public: virtual void CloseTab() override; virtual void LoadSettings() override; + void Reattach(HWND hwndContainer); + ParentWindowData *m_pParent; int m_minLogBoxHeight, m_minEditBoxHeight; HWND m_hwndIeview; diff --git a/plugins/Scriver/src/stdafx.h b/plugins/Scriver/src/stdafx.h index 77a01e40a2..09d0124a84 100644 --- a/plugins/Scriver/src/stdafx.h +++ b/plugins/Scriver/src/stdafx.h @@ -91,7 +91,7 @@ extern HWND SM_FindWindowByContact(MCONTACT hContact); extern HINSTANCE g_hInst; extern HCURSOR hDragCursor; extern ITaskbarList3 *pTaskbarInterface; -extern HANDLE hHookWinPopup, hHookWinWrite, hHookWinEvt; +extern HANDLE hHookWinPopup, hHookWinWrite; void ChangeStatusIcons(); void LoadInfobarFonts(); diff --git a/plugins/Scriver/src/tabs.cpp b/plugins/Scriver/src/tabs.cpp index 3b164494c6..7dbc4f7c91 100644 --- a/plugins/Scriver/src/tabs.cpp +++ b/plugins/Scriver/src/tabs.cpp @@ -429,55 +429,8 @@ LRESULT CALLBACK TabCtrlProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) tci.mask = TCIF_PARAM; TabCtrl_GetItem(hwnd, dat->srcTab, &tci); CScriverWindow *pDlg = (CScriverWindow*)tci.lParam; - if (pDlg != nullptr) { - HWND hChild = pDlg->GetHwnd(); - MCONTACT hContact = pDlg->m_hContact; - - POINT pt; - GetCursorPos(&pt); - HWND hParent = WindowFromPoint(pt); - while (GetParent(hParent) != nullptr) - hParent = GetParent(hParent); - - hParent = WindowList_Find(g_dat.hParentWindowList, (UINT_PTR)hParent); - if ((hParent != nullptr && hParent != GetParent(hwnd)) || (hParent == nullptr && pDlg->m_pParent->childrenCount > 1 && (GetKeyState(VK_CONTROL) & 0x8000))) { - if (hParent == nullptr) { - hParent = GetParentWindow(hContact, FALSE); - - RECT rc; - GetWindowRect(hParent, &rc); - - rc.right = (rc.right - rc.left); - rc.bottom = (rc.bottom - rc.top); - rc.left = pt.x - rc.right / 2; - rc.top = pt.y - rc.bottom / 2; - HMONITOR hMonitor = MonitorFromRect(&rc, MONITOR_DEFAULTTONEAREST); - - MONITORINFO mi; - mi.cbSize = sizeof(mi); - GetMonitorInfo(hMonitor, &mi); - - RECT rcDesktop = mi.rcWork; - if (rc.left < rcDesktop.left) - rc.left = rcDesktop.left; - if (rc.top < rcDesktop.top) - rc.top = rcDesktop.top; - MoveWindow(hParent, rc.left, rc.top, rc.right, rc.bottom, FALSE); - } - NotifyLocalWinEvent(hContact, hChild, MSG_WINDOW_EVT_CLOSING); - NotifyLocalWinEvent(hContact, hChild, MSG_WINDOW_EVT_CLOSE); - SetParent(hChild, hParent); - SendMessage(GetParent(hwnd), CM_REMOVECHILD, 0, (LPARAM)hChild); - SendMessage(hChild, DM_SETPARENT, 0, (LPARAM)hParent); - SendMessage(hParent, CM_ADDCHILD, (WPARAM)pDlg, 0); - SendMessage(hChild, DM_UPDATETABCONTROL, 0, 0); - SendMessage(hParent, CM_ACTIVATECHILD, 0, (LPARAM)hChild); - NotifyLocalWinEvent(hContact, hChild, MSG_WINDOW_EVT_OPENING); - NotifyLocalWinEvent(hContact, hChild, MSG_WINDOW_EVT_OPEN); - ShowWindow(hParent, SW_SHOWNA); - EnableWindow(hParent, TRUE); - } - } + if (pDlg != nullptr) + pDlg->Reattach(GetParent(hwnd)); } else { dat->destTab = -1; @@ -485,13 +438,13 @@ LRESULT CALLBACK TabCtrlProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) } } else if (dat->srcTab >= 0 && g_dat.flags2 & SMF2_TABCLOSEBUTTON) { - IMAGEINFO info; - POINT pt; - RECT rect; int atTop = (GetWindowLongPtr(hwnd, GWL_STYLE) & TCS_BOTTOM) == 0; + + RECT rect; TabCtrl_GetItemRect(hwnd, dat->srcTab, &rect); - pt.x = LOWORD(lParam); - pt.y = HIWORD(lParam); + + POINT pt = { LOWORD(lParam), HIWORD(lParam) }; + IMAGEINFO info; ImageList_GetImageInfo(g_dat.hButtonIconList, 0, &info); rect.left = rect.right - (info.rcImage.right - info.rcImage.left) - 6; if (!atTop) diff --git a/plugins/Scriver/src/tabs.h b/plugins/Scriver/src/tabs.h index bafb7c4518..9af8c6d786 100644 --- a/plugins/Scriver/src/tabs.h +++ b/plugins/Scriver/src/tabs.h @@ -84,7 +84,6 @@ struct TabControlData HICON hIcon; }; -HWND GetParentWindow(MCONTACT hContact, BOOL bChat); -void NotifyLocalWinEvent(MCONTACT hContact, HWND hwnd, unsigned int type); +HWND GetParentWindow(MCONTACT hContact, BOOL bChat); #endif diff --git a/plugins/TabSRMM/src/chat_window.cpp b/plugins/TabSRMM/src/chat_window.cpp index 77574de5a7..d73ca8f181 100644 --- a/plugins/TabSRMM/src/chat_window.cpp +++ b/plugins/TabSRMM/src/chat_window.cpp @@ -527,7 +527,7 @@ void CChatRoomDlg::OnInitDialog() m_log.SendMsg(EM_SETOLECALLBACK, 0, (LPARAM)&reOleCallback); m_log.SendMsg(EM_AUTOURLDETECT, 1, 0); SetWindowLongPtr(GetDlgItem(m_hwnd, IDC_PANELSPLITTER), GWLP_WNDPROC, (LONG_PTR)SplitterSubclassProc); - FireEvent(MSG_WINDOW_EVT_OPENING, 0); + NotifyEvent(MSG_WINDOW_EVT_OPENING); m_log.SendMsg(EM_SETEVENTMASK, 0, m_log.SendMsg(EM_GETEVENTMASK, 0, 0) | ENM_LINK | ENM_MOUSEEVENTS | ENM_KEYEVENTS); m_log.SendMsg(EM_LIMITTEXT, 0x7FFFFFFF, 0); @@ -572,7 +572,7 @@ void CChatRoomDlg::OnInitDialog() ShowWindow(m_hwnd, SW_SHOW); UpdateNickList(); m_pContainer->m_hwndActive = m_hwnd; - FireEvent(MSG_WINDOW_EVT_OPEN, 0); + NotifyEvent(MSG_WINDOW_EVT_OPEN); } void CChatRoomDlg::OnDestroy() @@ -588,7 +588,7 @@ void CChatRoomDlg::OnDestroy() m_si->pDlg = nullptr; m_si = nullptr; - FireEvent(MSG_WINDOW_EVT_CLOSING, 0); + NotifyEvent(MSG_WINDOW_EVT_CLOSING); DM_FreeTheme(); @@ -617,7 +617,7 @@ void CChatRoomDlg::OnDestroy() M.RemoveWindow(m_hwnd); - FireEvent(MSG_WINDOW_EVT_CLOSE, 0); + NotifyEvent(MSG_WINDOW_EVT_CLOSE); m_pContainer->ClearMargins(); PostMessage(m_pContainer->m_hwnd, WM_SIZE, 0, 1); @@ -1312,11 +1312,10 @@ LRESULT CChatRoomDlg::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) } return 0; } + if (wParam != VK_RIGHT && wParam != VK_LEFT) { - mir_free(m_wszSearchQuery); - m_wszSearchQuery = nullptr; - mir_free(m_wszSearchResult); - m_wszSearchResult = nullptr; + replaceStrW(m_wszSearchQuery, nullptr); + replaceStrW(m_wszSearchResult, nullptr); } if (wParam == VK_F4 && isCtrl && !isAlt) { // ctrl-F4 (close tab) diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index 64b280b13e..9fd2aa5151 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -297,15 +297,13 @@ int CGlobals::ModulesLoaded(WPARAM, LPARAM) if (M.GetByte("avatarmode", -1) == -1) db_set_b(0, SRMSGMOD_T, "avatarmode", 2); - PluginConfig.g_hwndHotkeyHandler = CreateWindowEx(0, L"TSHK", L"", WS_POPUP, - 0, 0, 40, 40, 0, 0, g_hInst, nullptr); + PluginConfig.g_hwndHotkeyHandler = CreateWindowEx(0, L"TSHK", L"", WS_POPUP, 0, 0, 40, 40, 0, 0, g_hInst, nullptr); ::CreateTrayMenus(TRUE); if (nen_options.bTraySupport) ::CreateSystrayIcon(TRUE); CMenuItem mi; - SET_UID(mi, 0x9f68b822, 0xff97, 0x477d, 0xb7, 0x6d, 0xa5, 0x59, 0x33, 0x1c, 0x54, 0x40); mi.position = -500050005; mi.hIcolibItem = PluginConfig.g_iconContainer; @@ -468,7 +466,6 @@ int CGlobals::PreshutdownSendRecv(WPARAM, LPARAM) ::SI_DeinitStatusIcons(); // the event API - DestroyHookableEvent(PluginConfig.m_event_MsgWin); DestroyHookableEvent(PluginConfig.m_event_MsgPopup); DestroyHookableEvent(PluginConfig.m_event_WriteEvent); diff --git a/plugins/TabSRMM/src/globals.h b/plugins/TabSRMM/src/globals.h index 244a7f68f8..e73fb1f62a 100644 --- a/plugins/TabSRMM/src/globals.h +++ b/plugins/TabSRMM/src/globals.h @@ -136,7 +136,7 @@ public: COLORREF m_ipBackgroundGradient; COLORREF m_ipBackgroundGradientHigh; COLORREF m_tbBackgroundHigh, m_tbBackgroundLow, m_fillColor, m_cRichBorders, m_genericTxtColor; - HANDLE m_event_MsgWin, m_event_MsgPopup, m_event_WriteEvent; + HANDLE m_event_MsgPopup, m_event_WriteEvent; HGENMENU m_hMenuItem; BYTE m_useAeroPeek; diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 8f73008fb2..8c856fbdc8 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -725,7 +725,7 @@ void CSrmmWindow::OnInitDialog() SendDlgItemMessage(m_hwnd, IDC_TOGGLESIDEBAR, BUTTONSETCONTAINER, (LPARAM)m_pContainer, 0); SendDlgItemMessage(m_hwnd, IDC_TOGGLESIDEBAR, BUTTONSETASTOOLBARBUTTON, TRUE, 0); - FireEvent(MSG_WINDOW_EVT_OPENING); + NotifyEvent(MSG_WINDOW_EVT_OPENING); for (int i = 0; i < _countof(tooltips); i++) SendDlgItemMessage(m_hwnd, tooltips[i].id, BUTTONADDTOOLTIP, (WPARAM)TranslateW(tooltips[i].text), BATF_UNICODE); @@ -858,7 +858,7 @@ void CSrmmWindow::OnInitDialog() mir_subclassWindow(m_hwndHPP, HPPKFSubclassProc); m_dwFlags &= ~MWF_INITMODE; - FireEvent(MSG_WINDOW_EVT_OPEN); + NotifyEvent(MSG_WINDOW_EVT_OPEN); if (m_pContainer->dwFlags & CNT_CREATE_MINIMIZED) { m_pContainer->dwFlags &= ~CNT_CREATE_MINIMIZED; @@ -887,7 +887,7 @@ void CSrmmWindow::OnDestroy() DestroyWindow(m_hwndPanelPicParent); if (m_cache->isValid()) { // not valid means the contact was deleted - FireEvent(MSG_WINDOW_EVT_CLOSING); + NotifyEvent(MSG_WINDOW_EVT_CLOSING); AddContactToFavorites(m_hContact, m_cache->getNick(), m_cache->getActiveProto(), m_wszStatus, m_wStatus, Skin_LoadProtoIcon(m_cache->getActiveProto(), m_cache->getActiveStatus()), 1, PluginConfig.g_hMenuRecent); if (m_hContact) { @@ -946,7 +946,7 @@ void CSrmmWindow::OnDestroy() m_iTabID = -1; } - FireEvent(MSG_WINDOW_EVT_CLOSE); + NotifyEvent(MSG_WINDOW_EVT_CLOSE); // clean up IEView and H++ log windows if (m_hwndIEView != 0) { @@ -1168,12 +1168,6 @@ void CSrmmWindow::onClick_Ok(CCtrlButton*) DM_NotifyTyping(PROTOTYPE_SELFTYPING_OFF); DeletePopupsForContact(m_hContact, PU_REMOVE_ON_SEND); - if (M.GetByte("allow_sendhook", 0)) { - int result = FireEvent(MSG_WINDOW_EVT_CUSTOM, MAKELONG(flags, tabMSG_WINDOW_EVT_CUSTOM_BEFORESEND)); - if (result) - return; - } - sendQueue->addTo(this, memRequired, flags); } diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index a348800445..f9f02f9703 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -854,35 +854,6 @@ void TSAPI CreateImageList(BOOL bInitial) PluginConfig.g_IconTypingEvent = PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING]; } -int CTabBaseDlg::FireEvent(unsigned int type, unsigned int subType) -{ - if (m_hContact == 0 || m_hwnd == nullptr) - return 0; - - CSrmmWindow *dat = (CSrmmWindow*)GetWindowLongPtr(m_hwnd, GWLP_USERDATA); - if (dat == nullptr) - return 0; - - MessageWindowEventData mwe = { sizeof(mwe) }; - mwe.hContact = m_hContact; - mwe.hwndWindow = m_hwnd; - mwe.szModule = "tabSRMsgW"; - mwe.uType = type; - 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 = m_hwnd; - se.extraFlags = (unsigned int)(LOWORD(subType)); - se.local = dat->m_sendBuffer; - mwe.local = &se; - } - - return NotifyEventHooks(PluginConfig.m_event_MsgWin, 0, (LPARAM)&mwe); -} - ///////////////////////////////////////////////////////////////////////////////////////// // standard icon definitions @@ -1142,7 +1113,6 @@ static void TSAPI InitAPI() CB_InitCustomButtons(); // the event API - PluginConfig.m_event_MsgWin = CreateHookableEvent(ME_MSG_WINDOWEVENT); PluginConfig.m_event_MsgPopup = CreateHookableEvent(ME_MSG_WINDOWPOPUP); PluginConfig.m_event_WriteEvent = CreateHookableEvent(ME_MSG_PRECREATEEVENT); } diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index 1b3c4987d3..5ab3b1e144 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -252,7 +252,6 @@ protected: void DetermineMinHeight(); void FindFirstEvent(); - int FireEvent(unsigned int type, unsigned int subType = 0); void GetSendFormat(); bool IsAutoSplitEnabled() const; void ResizeIeView(); @@ -1002,17 +1001,6 @@ struct SIDEBARITEM { #include "templates.h" -struct TABSRMM_SessionInfo { - unsigned int cbSize; - unsigned short evtCode; - HWND hwnd; // handle of the message dialog (tab) - HWND hwndContainer; // handle of the parent container - HWND hwndInput; // handle of the input area (rich edit) - UINT extraFlags; - UINT extraFlagsEX; - void *local; -}; - // callback for the user menu entry #define MS_TABMSG_SETUSERPREFS "SRMsg_MOD/SetUserPrefs" -- cgit v1.2.3