summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-04-24 14:20:47 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-04-24 14:20:47 +0000
commit48b4416cd73a0a6ff5cd83e448d4eab11b200224 (patch)
tree19a21432c3bf6f1cbd49e5e176e04d0914643799 /src
parentd9ae8968ec63cdfda5005143d2458f9ce824c427 (diff)
CDlgBase::Find() - useful helper for searching window classes
git-svn-id: http://svn.miranda-ng.org/main/trunk@13086 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/mir_core/src/mir_core.def1
-rw-r--r--src/mir_core/src/mir_core64.def1
-rw-r--r--src/mir_core/src/ui_utils.cpp17
3 files changed, 11 insertions, 8 deletions
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def
index 6935548cb0..464ba16984 100644
--- a/src/mir_core/src/mir_core.def
+++ b/src/mir_core/src/mir_core.def
@@ -1074,3 +1074,4 @@ ProtoWindowRemove @1072 NONAME
Proto_IsProtocolLoaded @1073 NONAME
Proto_RegisterModule @1074 NONAME
?GetInst@CDlgBase@@QBEPAUHINSTANCE__@@XZ @1075 NONAME
+?Find@CDlgBase@@SAPAV1@PAUHWND__@@@Z @1076 NONAME
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def
index 1e5e35b29c..8ded9a75f0 100644
--- a/src/mir_core/src/mir_core64.def
+++ b/src/mir_core/src/mir_core64.def
@@ -1075,3 +1075,4 @@ Proto_IsProtocolLoaded @1073 NONAME
Proto_RegisterModule @1074 NONAME
?GetInst@CDlgBase@@QEBAPEAUHINSTANCE__@@XZ @1075 NONAME
+?Find@CDlgBase@@SAPEAV1@PEAUHWND__@@@Z @1076 NONAME
diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp
index 5765d533b3..1148ab247a 100644
--- a/src/mir_core/src/ui_utils.cpp
+++ b/src/mir_core/src/ui_utils.cpp
@@ -220,20 +220,14 @@ INT_PTR CALLBACK CDlgBase::GlobalDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
mir_cslock lck(csDialogs);
arDialogs.insert(wnd);
}
- else {
- PVOID bullshit[2]; // vfptr + hwnd
- bullshit[1] = hwnd;
- wnd = arDialogs.find((CDlgBase*)&bullshit);
- }
+ else wnd = CDlgBase::Find(hwnd);
return (wnd == NULL) ? FALSE : wnd->DlgProc(msg, wParam, lParam);
}
int CDlgBase::GlobalDlgResizer(HWND hwnd, LPARAM, UTILRESIZECONTROL *urc)
{
- PVOID bullshit[2]; // vfptr + hwnd
- bullshit[1] = hwnd;
- CDlgBase *wnd = arDialogs.find((CDlgBase*)&bullshit);
+ CDlgBase *wnd = wnd = CDlgBase::Find(hwnd);
return (wnd == NULL) ? 0 : wnd->Resizer(urc);
}
@@ -259,6 +253,13 @@ CCtrlBase* CDlgBase::FindControl(int idCtrl)
return m_controls.find(&search);
}
+CDlgBase* CDlgBase::Find(HWND hwnd)
+{
+ PVOID bullshit[2]; // vfptr + hwnd
+ bullshit[1] = hwnd;
+ return arDialogs.find((CDlgBase*)&bullshit);
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
// CCtrlCombo class