summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-04-07 15:32:08 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-04-07 15:32:08 +0300
commit978b44865b77eb0029e6033dcbfc0876954cef2e (patch)
treeccdf74bb1e55640a5dadcd7693928adcf72a17e8 /src/mir_app
parentc46f4344f007d814131d25fa5aec6fdb4c7a049d (diff)
SRMM events are now created inside the core to avoid problems with dynamic plugin unload
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/chat.h1
-rw-r--r--src/mir_app/src/chat_svc.cpp7
-rw-r--r--src/mir_app/src/chat_tools.cpp4
3 files changed, 8 insertions, 4 deletions
diff --git a/src/mir_app/src/chat.h b/src/mir_app/src/chat.h
index fca1458400..cfc262e3eb 100644
--- a/src/mir_app/src/chat.h
+++ b/src/mir_app/src/chat.h
@@ -43,6 +43,7 @@ extern HCURSOR g_hCurHyperlinkHand;
extern char* pLogIconBmpBits[14];
extern LIST<SESSION_INFO> g_arSessions;
extern MWindowList g_hWindowList;
+extern HANDLE hevSendEvent, hevBuildMenuEvent;
// log.c
void LoadMsgLogBitmaps(void);
diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp
index da3deabc4a..99ab00f793 100644
--- a/src/mir_app/src/chat_svc.cpp
+++ b/src/mir_app/src/chat_svc.cpp
@@ -781,9 +781,12 @@ int LoadChatModule(void)
HookEvent(ME_SKIN_ICONSCHANGED, IconsChanged);
g_hWindowList = WindowList_Create();
- chatApi.hSendEvent = CreateHookableEvent(ME_GC_EVENT);
- chatApi.hBuildMenuEvent = CreateHookableEvent(ME_GC_BUILDMENU);
hHookEvent = CreateHookableEvent(ME_GC_HOOK_EVENT);
+ hevSendEvent = CreateHookableEvent(ME_GC_EVENT);
+ hevBuildMenuEvent = CreateHookableEvent(ME_GC_BUILDMENU);
+
+ chatApi.hevPreCreate = CreateHookableEvent(ME_MSG_PRECREATEEVENT);
+ chatApi.hevWinPopup = CreateHookableEvent(ME_MSG_WINDOWPOPUP);
HookEvent(ME_FONT_RELOAD, FontsChanged);
HookEvent(ME_SKIN2_ICONSCHANGED, IconsChanged);
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp
index 2e03698412..2b0ccdde6b 100644
--- a/src/mir_app/src/chat_tools.cpp
+++ b/src/mir_app/src/chat_tools.cpp
@@ -622,7 +622,7 @@ MIR_APP_DLL(BOOL) Chat_DoEventHook(SESSION_INFO *si, int iType, const USERINFO *
gch.ptszText = (LPTSTR)pszText;
gch.dwData = dwItem;
gch.pDest = &gcd;
- NotifyEventHooks(chatApi.hSendEvent, 0, (WPARAM)&gch);
+ NotifyEventHooks(hevSendEvent, 0, (WPARAM)&gch);
return TRUE;
}
@@ -821,7 +821,7 @@ MIR_APP_DLL(UINT) Chat_CreateGCMenu(HWND hwnd, HMENU hMenu, POINT pt, SESSION_IN
gcmi.Type = MENU_ON_NICKLIST;
}
- NotifyEventHooks(chatApi.hBuildMenuEvent, 0, (WPARAM)&gcmi);
+ NotifyEventHooks(hevBuildMenuEvent, 0, (WPARAM)&gcmi);
return TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwnd, nullptr);
}