diff options
-rw-r--r-- | include/m_gui.h | 1 | ||||
-rw-r--r-- | src/mir_core/src/CDlgBase.cpp | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/include/m_gui.h b/include/m_gui.h index 14b302fac6..27f91b99e7 100644 --- a/include/m_gui.h +++ b/include/m_gui.h @@ -468,6 +468,7 @@ private: CTimer* FindTimer(int idEvent);
+ static BOOL CALLBACK GlobalFieldEnum(HWND hwnd, LPARAM lParam);
static INT_PTR CALLBACK GlobalDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
static int GlobalDlgResizer(HWND hwnd, LPARAM lParam, UTILRESIZECONTROL *urc);
};
diff --git a/src/mir_core/src/CDlgBase.cpp b/src/mir_core/src/CDlgBase.cpp index f975f38f8b..eaa9954261 100644 --- a/src/mir_core/src/CDlgBase.cpp +++ b/src/mir_core/src/CDlgBase.cpp @@ -120,6 +120,25 @@ int CDlgBase::Resizer(UTILRESIZECONTROL*) return RD_ANCHORX_LEFT | RD_ANCHORY_TOP; } +BOOL CALLBACK CDlgBase::GlobalFieldEnum(HWND hwnd, LPARAM lParam) +{ + CDlgBase *pDlg = (CDlgBase*)lParam; + int id = GetWindowLongPtr(hwnd, GWLP_ID); + if (id <= 0) + return TRUE; + + CCtrlBase *ctrl = pDlg->FindControl(id); + if (ctrl != nullptr) + return TRUE; + + wchar_t wszClass[100]; + GetClassName(hwnd, wszClass, _countof(wszClass)); + if (!wcsicmp(wszClass, L"EDIT")) + new CCtrlEdit(pDlg, id); + + return TRUE; +} + INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { @@ -127,6 +146,8 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) m_initialized = false; TranslateDialog_LP(m_hwnd, GetPluginLangByInstance(m_hInst)); + ::EnumChildWindows(m_hwnd, &GlobalFieldEnum, LPARAM(this)); + NotifyControls(&CCtrlBase::OnInit); OnInitDialog(); |