summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-03-28 14:18:31 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-03-28 14:18:31 +0300
commit6a9e3738066370dac38f5f6768b8a6f61fe709e0 (patch)
tree035d3b553c313505707f236e6c9c973416e1be65 /src
parentb60c918dbcb16f4da7c35c15b190ee9def957a49 (diff)
SRMM notifications went to the core with ME_MSG_WINDOWEVENT
Diffstat (limited to 'src')
-rw-r--r--src/core/stdmsg/src/chat_window.cpp10
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp25
-rw-r--r--src/core/stdmsg/src/stdafx.h3
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
-rw-r--r--src/mir_app/src/srmm_base.cpp17
6 files changed, 29 insertions, 28 deletions
diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp
index 51f5ab8a98..5ba99792bb 100644
--- a/src/core/stdmsg/src/chat_window.cpp
+++ b/src/core/stdmsg/src/chat_window.cpp
@@ -64,7 +64,7 @@ void CChatRoomDlg::OnInitDialog()
WindowList_Add(pci->hWindowList, m_hwnd, m_hContact);
- NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_OPENING);
+ NotifyEvent(MSG_WINDOW_EVT_OPENING);
m_log.SendMsg(EM_AUTOURLDETECT, 1, 0);
@@ -89,12 +89,12 @@ void CChatRoomDlg::OnInitDialog()
SendMessage(m_hwnd, WM_SIZE, 0, 0);
- 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);
SaveWindowPosition(true);
if (!g_Settings.bTabsEnable) {
@@ -112,7 +112,7 @@ void CChatRoomDlg::OnDestroy()
m_si->wState &= ~STATE_TALK;
DestroyWindow(m_hwndStatus); m_hwndStatus = nullptr;
- NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_CLOSE);
+ NotifyEvent(MSG_WINDOW_EVT_CLOSE);
CSuper::OnDestroy();
}
@@ -764,7 +764,7 @@ LRESULT CChatRoomDlg::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam)
if (ProcessHotkeys(wParam, isShift, isCtrl, isAlt))
return TRUE;
- if (wParam == 0x46 && isCtrl && !isAlt) { // ctrl-f (paste clean text)
+ if (wParam == 0x46 && isCtrl && !isAlt) { // ctrl-f (toggle filter)
onClick_Filter(&m_btnFilter);
return TRUE;
}
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index 71ec207848..689916ccfb 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -35,22 +35,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static const UINT sendControls[] = { IDC_SRMM_MESSAGE };
-void NotifyLocalWinEvent(MCONTACT hContact, HWND hwnd, unsigned int type)
-{
- if (hContact != NULL && hwnd != NULL) {
- MessageWindowEventData mwe = {};
- mwe.cbSize = sizeof(mwe);
- mwe.hContact = hContact;
- mwe.hwndWindow = hwnd;
- mwe.szModule = SRMMMOD;
- 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);
- }
-}
-
static int RTL_Detect(const wchar_t *ptszText)
{
int iLen = (int)mir_wstrlen(ptszText);
@@ -141,7 +125,7 @@ void CSrmmWindow::OnInitDialog()
m_hTimeZone = TimeZone_CreateByContact(m_hContact, 0, TZF_KNOWNONLY);
m_wMinute = 61;
- NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_OPENING);
+ NotifyEvent(MSG_WINDOW_EVT_OPENING);
if (m_wszInitialText) {
m_message.SetText(m_wszInitialText);
@@ -298,13 +282,13 @@ void CSrmmWindow::OnInitDialog()
}
SendMessage(m_hwnd, DM_GETAVATAR, 0, 0);
- NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_OPEN);
+ NotifyEvent(MSG_WINDOW_EVT_OPEN);
}
void CSrmmWindow::OnDestroy()
{
SetWindowLongPtr(m_hwnd, GWLP_USERDATA, 0);
- NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_CLOSING);
+ NotifyEvent(MSG_WINDOW_EVT_CLOSING);
// save string from the editor
if (m_hContact) {
@@ -346,7 +330,7 @@ void CSrmmWindow::OnDestroy()
db_set_dw(hContact, SRMMMOD, "width", wp.rcNormalPosition.right - wp.rcNormalPosition.left);
db_set_dw(hContact, SRMMMOD, "height", wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
- NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_CLOSE);
+ NotifyEvent(MSG_WINDOW_EVT_CLOSE);
if (m_hContact && g_dat.bDeleteTempCont)
if (db_get_b(m_hContact, "CList", "NotOnList", 0))
db_delete_contact(m_hContact);
@@ -741,7 +725,6 @@ LRESULT CSrmmWindow::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam)
static const CHARRANGE all = { 0, -1 };
MessageWindowPopupData mwpd = {};
- mwpd.cbSize = sizeof(mwpd);
mwpd.uType = MSG_WINDOWPOPUP_SHOWING;
mwpd.uFlags = MSG_WINDOWPOPUP_INPUT;
mwpd.hContact = m_hContact;
diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h
index 7d7e196839..b97132d10e 100644
--- a/src/core/stdmsg/src/stdafx.h
+++ b/src/core/stdmsg/src/stdafx.h
@@ -81,7 +81,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define GC_SWITCHTAB (WM_USER+0x106)
extern HINSTANCE g_hInst;
-extern HANDLE hHookWinEvt, hHookWinPopup, hHookWinWrite;
+extern HANDLE hHookWinPopup, hHookWinWrite;
extern CREOleCallback reOleCallback;
/////////////////////////////////////////////////////////////////////////////////////////
@@ -150,7 +150,6 @@ int RestoreWindowPosition(HWND hwnd, MCONTACT hContact, bool bHide);
// message.cpp
char* Message_GetFromStream(HWND hwndDlg, SESSION_INFO *si);
-void NotifyLocalWinEvent(MCONTACT hContact, HWND hwnd, unsigned int type);
// tabs.cpp
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index 9e7da2d190..8b65c2bcb6 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -444,3 +444,4 @@ _stubLogProc@16 @446 NONAME
_stubMessageProc@16 @447 NONAME
_stubNicklistProc@16 @448 NONAME
Chat_GetTextPixelSize @449 NONAME
+?NotifyEvent@CSrmmBaseDialog@@IAEHH@Z @450 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index fd8431c520..856beb7707 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -444,3 +444,4 @@ stubLogProc @446 NONAME
stubMessageProc @447 NONAME
stubNicklistProc @448 NONAME
Chat_GetTextPixelSize @449 NONAME
+?NotifyEvent@CSrmmBaseDialog@@IEAAHH@Z @450 NONAME
diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp
index 01b401f1f2..9543f2e1e5 100644
--- a/src/mir_app/src/srmm_base.cpp
+++ b/src/mir_app/src/srmm_base.cpp
@@ -812,6 +812,23 @@ void CSrmmBaseDialog::onDblClick_List(CCtrlListBox *pList)
/////////////////////////////////////////////////////////////////////////////////////////
+extern HANDLE hHookSrmmEvent;
+
+int CSrmmBaseDialog::NotifyEvent(int code)
+{
+ if (m_hContact == 0 && m_hwnd == nullptr)
+ return -1;
+
+ MessageWindowEventData mwe = {};
+ mwe.hContact = m_hContact;
+ mwe.hwndWindow = m_hwnd;
+ mwe.uType = code;
+ mwe.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
+ mwe.hwndInput = m_message.GetHwnd();
+ mwe.hwndLog = m_log.GetHwnd();
+ return ::NotifyEventHooks(hHookSrmmEvent, 0, (LPARAM)&mwe);
+}
+
bool CSrmmBaseDialog::ProcessHotkeys(int key, bool isShift, bool isCtrl, bool isAlt)
{
// Esc (close tab)