summaryrefslogtreecommitdiff
path: root/plugins/SmileyAdd/src/dlgboxsubclass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/SmileyAdd/src/dlgboxsubclass.cpp')
-rw-r--r--plugins/SmileyAdd/src/dlgboxsubclass.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/plugins/SmileyAdd/src/dlgboxsubclass.cpp b/plugins/SmileyAdd/src/dlgboxsubclass.cpp
index 6a560a4127..4f0618b49b 100644
--- a/plugins/SmileyAdd/src/dlgboxsubclass.cpp
+++ b/plugins/SmileyAdd/src/dlgboxsubclass.cpp
@@ -122,11 +122,21 @@ int SmileyButtonPressed(WPARAM, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
// window hook
+static HWND checkRichEdit(HWND hwnd)
+{
+ wchar_t wszClass[200];
+ if (GetClassNameW(hwnd, wszClass, _countof(wszClass)))
+ if (!wcsicmp(wszClass, L"RICHEDIT50W"))
+ return hwnd;
+
+ return nullptr;
+}
+
static int MsgDlgHook(WPARAM uType, LPARAM lParam)
{
auto *pDlg = (CSrmmBaseDialog *)lParam;
- auto hwndLog = pDlg->log()->GetHwnd();
- auto hwndInput = pDlg->GetInput();
+ auto hwndLog = checkRichEdit(pDlg->log()->GetHwnd());
+ auto hwndInput = checkRichEdit(pDlg->GetInput());
switch (uType) {
case MSG_WINDOW_EVT_OPENING:
@@ -157,10 +167,7 @@ static int MsgDlgHook(WPARAM uType, LPARAM lParam)
break;
case MSG_WINDOW_EVT_CLOSE:
- if (hwndLog) {
- CloseRichCallback(hwndLog);
- CloseRichOwnerCallback(pDlg->GetHwnd());
- }
+ CloseRichOwnerCallback(pDlg->GetHwnd());
mir_cslock lck(csWndList);
g_MsgWndList.remove((MsgWndData *)&pDlg);