diff options
author | George Hazan <ghazan@miranda.im> | 2017-04-03 23:52:09 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-04-03 23:52:09 +0300 |
commit | 7f513673b523ecfbf6ded0a2d0e5cdf5496bd6b0 (patch) | |
tree | 676bd7211644596d2faf9e95cb0acf7f1f2cb7ee /src | |
parent | 62cb48be341f443dbe356d37fb6d708167898ded (diff) |
- SRMM window list management moved to the base class;
- fixes #791
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdmsg/src/chat_window.cpp | 5 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 5 | ||||
-rw-r--r-- | src/mir_app/src/srmm_base.cpp | 5 |
3 files changed, 5 insertions, 10 deletions
diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp index aaf6ee3a50..ea68c9c571 100644 --- a/src/core/stdmsg/src/chat_window.cpp +++ b/src/core/stdmsg/src/chat_window.cpp @@ -55,7 +55,6 @@ void CChatRoomDlg::OnInitDialog() { CSrmmBaseDialog::OnInitDialog(); m_si->pDlg = this; - SetWindowLongPtr(m_hwnd, GWLP_USERDATA, LPARAM(this)); if (g_Settings.bTabsEnable) SetWindowLongPtr(m_hwnd, GWL_EXSTYLE, GetWindowLongPtr(m_hwnd, GWL_EXSTYLE) | WS_EX_APPWINDOW); @@ -63,8 +62,6 @@ void CChatRoomDlg::OnInitDialog() // initialize toolbar icons Srmm_CreateToolbarIcons(m_hwnd, BBBF_ISCHATBUTTON); - WindowList_Add(pci->hWindowList, m_hwnd, m_hContact); - NotifyEvent(MSG_WINDOW_EVT_OPENING); m_log.SendMsg(EM_AUTOURLDETECT, 1, 0); @@ -86,8 +83,6 @@ void CChatRoomDlg::OnDestroy() { NotifyEvent(MSG_WINDOW_EVT_CLOSING); - WindowList_Remove(pci->hWindowList, m_hwnd); - m_si->pDlg = nullptr; m_si->wState &= ~STATE_TALK; diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 4059a6ba1e..8b6ae10ed8 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -116,7 +116,6 @@ CSrmmWindow::CSrmmWindow(MCONTACT hContact) : void CSrmmWindow::OnInitDialog()
{
CSrmmBaseDialog::OnInitDialog();
- SetWindowLongPtr(m_hwnd, GWLP_USERDATA, (LPARAM)this);
m_bIsMeta = db_mc_isMeta(m_hContact) != 0;
m_hTimeZone = TimeZone_CreateByContact(m_hContact, 0, TZF_KNOWNONLY);
@@ -156,7 +155,6 @@ void CSrmmWindow::OnInitDialog() Srmm_CreateToolbarIcons(m_hwnd, BBBF_ISIMBUTTON);
- WindowList_Add(pci->hWindowList, m_hwnd, m_hContact);
GetWindowRect(m_message.GetHwnd(), &m_minEditInit);
SendMessage(m_hwnd, DM_UPDATESIZEBAR, 0, 0);
m_hwndStatus = nullptr;
@@ -284,7 +282,6 @@ void CSrmmWindow::OnInitDialog() void CSrmmWindow::OnDestroy()
{
- SetWindowLongPtr(m_hwnd, GWLP_USERDATA, 0);
NotifyEvent(MSG_WINDOW_EVT_CLOSING);
// save string from the editor
@@ -308,8 +305,6 @@ void CSrmmWindow::OnDestroy() mir_free(m_cmdList[i]);
m_cmdList.destroy();
- WindowList_Remove(pci->hWindowList, m_hwnd);
-
MCONTACT hContact = (g_dat.bSavePerContact) ? m_hContact : 0;
db_set_dw(hContact ? m_hContact : 0, SRMMMOD, "splitterPos", m_splitterPos);
diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp index 3c737fd772..62d744f540 100644 --- a/src/mir_app/src/srmm_base.cpp +++ b/src/mir_app/src/srmm_base.cpp @@ -577,6 +577,9 @@ LRESULT CSrmmBaseDialog::WndProc_Nicklist(UINT msg, WPARAM wParam, LPARAM lParam void CSrmmBaseDialog::OnInitDialog() { + WindowList_Add(chatApi.hWindowList, m_hwnd, m_hContact); + SetWindowLongPtr(m_hwnd, GWLP_USERDATA, (LONG_PTR)this); + SetWindowLongPtr(m_log.GetHwnd(), GWLP_USERDATA, LPARAM(this)); mir_subclassWindow(m_log.GetHwnd(), stubLogProc); @@ -595,6 +598,8 @@ void CSrmmBaseDialog::OnInitDialog() void CSrmmBaseDialog::OnDestroy() { + WindowList_Remove(chatApi.hWindowList, m_hwnd); + SetWindowLongPtr(m_hwnd, GWLP_USERDATA, 0); mir_unsubclassWindow(m_log.GetHwnd(), stubLogProc); mir_unsubclassWindow(m_message.GetHwnd(), stubMessageProc); |