summaryrefslogtreecommitdiff
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
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
-rw-r--r--bin10/lib/mir_core.libbin327496 -> 327802 bytes
-rw-r--r--bin10/lib/mir_core64.libbin329216 -> 329532 bytes
-rw-r--r--bin12/lib/mir_core.libbin327496 -> 327802 bytes
-rw-r--r--bin12/lib/mir_core64.libbin329216 -> 329532 bytes
-rw-r--r--include/m_gui.h2
-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
8 files changed, 13 insertions, 8 deletions
diff --git a/bin10/lib/mir_core.lib b/bin10/lib/mir_core.lib
index 5a9ff0446d..e0579bd66a 100644
--- a/bin10/lib/mir_core.lib
+++ b/bin10/lib/mir_core.lib
Binary files differ
diff --git a/bin10/lib/mir_core64.lib b/bin10/lib/mir_core64.lib
index 31c02b4c9e..80bc55baf0 100644
--- a/bin10/lib/mir_core64.lib
+++ b/bin10/lib/mir_core64.lib
Binary files differ
diff --git a/bin12/lib/mir_core.lib b/bin12/lib/mir_core.lib
index 56b61f9db5..4f6f25252d 100644
--- a/bin12/lib/mir_core.lib
+++ b/bin12/lib/mir_core.lib
Binary files differ
diff --git a/bin12/lib/mir_core64.lib b/bin12/lib/mir_core64.lib
index b1f52a5f09..80bc55baf0 100644
--- a/bin12/lib/mir_core64.lib
+++ b/bin12/lib/mir_core64.lib
Binary files differ
diff --git a/include/m_gui.h b/include/m_gui.h
index c85d53dd29..3e3d783fb1 100644
--- a/include/m_gui.h
+++ b/include/m_gui.h
@@ -273,6 +273,8 @@ public:
__forceinline void SetParent(HWND hwnd) { m_hwndParent = hwnd; }
__forceinline void Close() { SendMessage(m_hwnd, WM_CLOSE, 0, 0); }
+ static CDlgBase* Find(HWND hwnd);
+
protected:
HWND m_hwnd; // must be the first data item
HINSTANCE m_hInst;
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