summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-03-23 22:06:53 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-03-23 22:06:53 +0300
commit34e059269d3c8a5d999575efce347c116b7be52a (patch)
tree054a2d928dd54ae5de71114636b38e6e6b3d8687 /src
parent7d191d7bf8dc09f8484a05d898c8d0971beaa10b (diff)
usual crutches sometimes don't work, we need the stronger ones
Diffstat (limited to 'src')
-rw-r--r--src/core/stdmsg/src/chat_window.cpp2
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp2
-rw-r--r--src/core/stdmsg/src/msgs.h1
-rw-r--r--src/core/stdmsg/src/stdafx.h1
-rw-r--r--src/mir_app/src/mir_app.def2
-rw-r--r--src/mir_app/src/mir_app64.def2
-rw-r--r--src/mir_app/src/srmm_base.cpp9
7 files changed, 13 insertions, 6 deletions
diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp
index 24057875bc..3247b0ef98 100644
--- a/src/core/stdmsg/src/chat_window.cpp
+++ b/src/core/stdmsg/src/chat_window.cpp
@@ -142,6 +142,8 @@ void CChatRoomDlg::OnDestroy()
DestroyWindow(m_hwndStatus); m_hwndStatus = nullptr;
NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_CLOSE);
+
+ CSuper::OnDestroy();
}
void CChatRoomDlg::onClick_Filter(CCtrlButton *pButton)
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index 506bd38cd3..fa99f057f7 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -357,6 +357,8 @@ void CSrmmWindow::OnDestroy()
db_delete_contact(m_hContact);
Window_FreeIcon_IcoLib(m_hwnd);
+
+ CSuper::OnDestroy();
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/stdmsg/src/msgs.h b/src/core/stdmsg/src/msgs.h
index e3dc7252f3..83bdc4f3d2 100644
--- a/src/core/stdmsg/src/msgs.h
+++ b/src/core/stdmsg/src/msgs.h
@@ -50,6 +50,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
class CSrmmWindow : public CSrmmBaseDialog
{
friend struct CTabbedWindow;
+ typedef CSrmmBaseDialog CSuper;
static LRESULT CALLBACK TabSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h
index 5ad8cfb5a5..c09f311e83 100644
--- a/src/core/stdmsg/src/stdafx.h
+++ b/src/core/stdmsg/src/stdafx.h
@@ -206,6 +206,7 @@ void TB_SaveSession(SESSION_INFO *si);
class CChatRoomDlg : public CSrmmBaseDialog
{
+ typedef CSrmmBaseDialog CSuper;
friend struct CTabbedWindow;
static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index ad0242556b..3e4a88525d 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -436,4 +436,4 @@ Chat_UpdateOptions @418 NONAME
?WndProc_Message@CSrmmBaseDialog@@UAEJIIJ@Z @438 NONAME
?WndProc_Nicklist@CSrmmBaseDialog@@UAEJIIJ@Z @439 NONAME
?onDblClick_List@CSrmmBaseDialog@@IAEXPAVCCtrlListBox@@@Z @440 NONAME
-?OnClose@CSrmmBaseDialog@@MAEXXZ @441 NONAME
+?OnDestroy@CSrmmBaseDialog@@MAEXXZ @441 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index c16ce177a3..6dfa439270 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -436,4 +436,4 @@ Chat_UpdateOptions @418 NONAME
?WndProc_Message@CSrmmBaseDialog@@UEAA_JI_K_J@Z @438 NONAME
?WndProc_Nicklist@CSrmmBaseDialog@@UEAA_JI_K_J@Z @439 NONAME
?onDblClick_List@CSrmmBaseDialog@@IEAAXPEAVCCtrlListBox@@@Z @440 NONAME
-?OnClose@CSrmmBaseDialog@@MEAAXXZ @441 NONAME
+?OnDestroy@CSrmmBaseDialog@@MEAAXXZ @441 NONAME
diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp
index 8066b99851..689776bedd 100644
--- a/src/mir_app/src/srmm_base.cpp
+++ b/src/mir_app/src/srmm_base.cpp
@@ -133,7 +133,7 @@ LRESULT CSrmmBaseDialog::WndProc_Log(UINT /*msg*/, WPARAM /*wParam*/, LPARAM /*l
static LRESULT CALLBACK stubLogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- CSrmmBaseDialog *pDlg = (CSrmmBaseDialog*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ CSrmmBaseDialog *pDlg = (CSrmmBaseDialog*)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
if (pDlg != nullptr)
pDlg->WndProc_Log(msg, wParam, lParam);
@@ -149,7 +149,7 @@ LRESULT CSrmmBaseDialog::WndProc_Message(UINT /*msg*/, WPARAM /*wParam*/, LPARAM
static LRESULT CALLBACK stubMessageProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- CSrmmBaseDialog *pDlg = (CSrmmBaseDialog*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ CSrmmBaseDialog *pDlg = (CSrmmBaseDialog*)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
if (pDlg != nullptr)
pDlg->WndProc_Message(msg, wParam, lParam);
@@ -165,7 +165,7 @@ LRESULT CSrmmBaseDialog::WndProc_Nicklist(UINT /*msg*/, WPARAM /*wParam*/, LPARA
static LRESULT CALLBACK stubNicklistProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- CSrmmBaseDialog *pDlg = (CSrmmBaseDialog*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ CSrmmBaseDialog *pDlg = (CSrmmBaseDialog*)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
if (pDlg != nullptr)
pDlg->WndProc_Nicklist(msg, wParam, lParam);
@@ -192,8 +192,9 @@ void CSrmmBaseDialog::OnInitDialog()
LoadSettings();
}
-void CSrmmBaseDialog::OnClose()
+void CSrmmBaseDialog::OnDestroy()
{
+ SetWindowLongPtr(m_hwnd, GWLP_USERDATA, 0);
mir_unsubclassWindow(m_pLog->GetHwnd(), stubLogProc);
mir_unsubclassWindow(m_pEntry->GetHwnd(), stubMessageProc);
mir_unsubclassWindow(m_nickList.GetHwnd(), stubNicklistProc);