diff options
author | George Hazan <ghazan@miranda.im> | 2017-03-28 14:55:06 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-03-28 14:55:06 +0300 |
commit | 1e49d6b2cb3812d8e80051cbb3d44891e6532825 (patch) | |
tree | 2ffb8e36641e063d625faece1d380f4ce833d1a6 /plugins/TabSRMM | |
parent | eccbb5307a048e70ac4adb0d3fd333be28245fa8 (diff) |
funny, but without cbSize we have no need in MessageWindowInputData at all
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r-- | plugins/TabSRMM/src/msgs.cpp | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index f0e8c76e7f..136c85e07d 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -64,17 +64,16 @@ int SmileyAddOptionsChanged(WPARAM, LPARAM) // lparam = (MessageWindowData*)
// returns 0 on success and returns non-zero (1) on error or if no window data exists for that hcontact
-static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam)
+static INT_PTR GetWindowData(WPARAM hContact, LPARAM lParam)
{
- MessageWindowInputData *mwid = (MessageWindowInputData*)wParam;
- if (mwid == nullptr || mwid->hContact == 0 || mwid->uFlags != MSG_WINDOW_UFLAG_MSG_BOTH)
+ if (hContact == 0)
return 1;
MessageWindowData *mwd = (MessageWindowData*)lParam;
if (mwd == nullptr)
return 1;
- HWND hwnd = M.FindWindow(mwid->hContact);
+ HWND hwnd = M.FindWindow(hContact);
if (hwnd) {
mwd->uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
mwd->hwndWindow = hwnd;
@@ -83,24 +82,18 @@ static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam) mwd->uState = GetWindowLongPtr(hwnd, DWLP_MSGRESULT);
return 0;
}
- else
- {
- SESSION_INFO *si = SM_FindSessionByHCONTACT(mwid->hContact);
- if (si != nullptr && si->pDlg != nullptr) {
- mwd->uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
- mwd->hwndWindow = si->pDlg->GetHwnd();
- mwd->local = GetParent(GetParent(si->pDlg->GetHwnd()));
- SendMessage(si->pDlg->GetHwnd(), DM_GETWINDOWSTATE, 0, 0);
- mwd->uState = GetWindowLongPtr(si->pDlg->GetHwnd(), DWLP_MSGRESULT);
- return 0;
- }
- else {
- mwd->uState = 0;
- mwd->hContact = 0;
- mwd->hwndWindow = 0;
- mwd->uFlags = 0;
- }
+
+ SESSION_INFO *si = SM_FindSessionByHCONTACT(hContact);
+ if (si != nullptr && si->pDlg != nullptr) {
+ mwd->uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
+ mwd->hwndWindow = si->pDlg->GetHwnd();
+ mwd->local = GetParent(GetParent(si->pDlg->GetHwnd()));
+ SendMessage(si->pDlg->GetHwnd(), DM_GETWINDOWSTATE, 0, 0);
+ mwd->uState = GetWindowLongPtr(si->pDlg->GetHwnd(), DWLP_MSGRESULT);
+ return 0;
}
+
+ memset(mwd, 0, sizeof(*mwd));
return 1;
}
|