From 978b44865b77eb0029e6033dcbfc0876954cef2e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 7 Apr 2017 15:32:08 +0300 Subject: SRMM events are now created inside the core to avoid problems with dynamic plugin unload --- plugins/Scriver/src/globals.cpp | 2 +- plugins/Scriver/src/input.cpp | 6 ++---- plugins/Scriver/src/msgs.cpp | 7 ------- plugins/Scriver/src/stdafx.h | 1 - 4 files changed, 3 insertions(+), 13 deletions(-) (limited to 'plugins/Scriver') diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp index 36cd2601c6..670aabd547 100644 --- a/plugins/Scriver/src/globals.cpp +++ b/plugins/Scriver/src/globals.cpp @@ -152,7 +152,7 @@ static int ackevent(WPARAM, LPARAM lParam) dbei.pBlob = (PBYTE)item->sendBuffer; MessageWindowEvent evt = { item->hSendId, hContact, &dbei }; - NotifyEventHooks(hHookWinWrite, 0, (LPARAM)&evt); + NotifyEventHooks(pci->hevPreCreate, 0, (LPARAM)&evt); item->sendBuffer = (char *)dbei.pBlob; db_event_add(hContact, &dbei); diff --git a/plugins/Scriver/src/input.cpp b/plugins/Scriver/src/input.cpp index b2ec93eb56..7b2c7d5379 100644 --- a/plugins/Scriver/src/input.cpp +++ b/plugins/Scriver/src/input.cpp @@ -23,8 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" -extern HANDLE hHookWinPopup; - enum KB_ACTIONS {KB_PREV_TAB = 1, KB_NEXT_TAB, KB_SWITCHTOOLBAR, KB_SWITCHSTATUSBAR, KB_SWITCHTITLEBAR, KB_SWITCHINFOBAR, KB_MINIMIZE, KB_CLOSE, KB_CLEAR_LOG, KB_TAB1, KB_TAB2, KB_TAB3, KB_TAB4, KB_TAB5, KB_TAB6, KB_TAB7, KB_TAB8, KB_TAB9, KB_SEND_ALL, KB_PASTESEND, KB_QUOTE}; @@ -72,14 +70,14 @@ void InputAreaContextMenu(HWND hwnd, WPARAM, LPARAM lParam, MCONTACT hContact) mwpd.hMenu = hSubMenu; mwpd.selection = 0; mwpd.pt = pt; - NotifyEventHooks(hHookWinPopup, 0, (LPARAM)&mwpd); + NotifyEventHooks(pci->hevWinPopup, 0, (LPARAM)&mwpd); int selection = TrackPopupMenu(hSubMenu, TPM_RETURNCMD, pt.x, pt.y, 0, GetParent(hwnd), nullptr); // Second notification mwpd.selection = selection; mwpd.uType = MSG_WINDOWPOPUP_SELECTED; - NotifyEventHooks(hHookWinPopup, 0, (LPARAM)&mwpd); + NotifyEventHooks(pci->hevWinPopup, 0, (LPARAM)&mwpd); switch (selection) { case IDM_UNDO: diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index 3c56bc9a2f..3a977d8c62 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -24,7 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" HCURSOR hDragCursor; -HANDLE hHookWinPopup, hHookWinWrite; HGENMENU hMsgMenuItem; HMODULE hMsftEdit; @@ -618,9 +617,6 @@ int OnUnloadModule(void) { DestroyCursor(hDragCursor); - DestroyHookableEvent(hHookWinPopup); - DestroyHookableEvent(hHookWinWrite); - ReleaseIcons(); FreeMsgLogIcons(); FreeGlobals(); @@ -663,9 +659,6 @@ int OnLoadModule(void) CreateServiceFunction("SRMsg/ReadMessage", ReadMessageCommand); CreateServiceFunction("SRMsg/TypingMessage", TypingMessageCommand); - hHookWinPopup = CreateHookableEvent(ME_MSG_WINDOWPOPUP); - hHookWinWrite = CreateHookableEvent(ME_MSG_PRECREATEEVENT); - SkinAddNewSoundEx("RecvMsgActive", LPGEN("Instant messages"), LPGEN("Incoming (focused window)")); SkinAddNewSoundEx("RecvMsgInactive", LPGEN("Instant messages"), LPGEN("Incoming (unfocused window)")); SkinAddNewSoundEx("AlertMsg", LPGEN("Instant messages"), LPGEN("Incoming (new session)")); diff --git a/plugins/Scriver/src/stdafx.h b/plugins/Scriver/src/stdafx.h index d6ff0fed26..221cb7b0ca 100644 --- a/plugins/Scriver/src/stdafx.h +++ b/plugins/Scriver/src/stdafx.h @@ -90,7 +90,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern HINSTANCE g_hInst; extern HCURSOR hDragCursor; extern ITaskbarList3 *pTaskbarInterface; -extern HANDLE hHookWinPopup, hHookWinWrite; void ChangeStatusIcons(); void LoadInfobarFonts(); -- cgit v1.2.3