summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-04-13 21:38:10 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-04-13 21:38:10 +0000
commitd4dee7be1d5eab19b2cee2d94bd1671abd3446a3 (patch)
tree518ecf756c59c46e34831eb58a3eb2d2aea7a6eb /src
parenta58d37d39c039e755e5b902d5556fe34338130bc (diff)
added CDlgBase::GetInst() method to detect dialog's module automatically
git-svn-id: http://svn.miranda-ng.org/main/trunk@12797 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/core/miranda.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/modules/options/options.cpp14
4 files changed, 11 insertions, 7 deletions
diff --git a/src/core/miranda.h b/src/core/miranda.h
index e5f6c88c1f..5f0d7e2ddc 100644
--- a/src/core/miranda.h
+++ b/src/core/miranda.h
@@ -22,8 +22,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#define OPTIONPAGE_OLD_SIZE offsetof(OPTIONSDIALOGPAGE,hLangpack)
-
typedef HRESULT (STDAPICALLTYPE *pfnDrawThemeTextEx)(HTHEME, HDC, int, int, LPCWSTR, int, DWORD, LPRECT, const struct _DTTOPTS *);
typedef HRESULT (STDAPICALLTYPE *pfnSetWindowThemeAttribute)(HWND, enum WINDOWTHEMEATTRIBUTETYPE, PVOID, DWORD);
typedef HRESULT (STDAPICALLTYPE *pfnBufferedPaintInit)(void);
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def
index 3809861dc2..8196e031dc 100644
--- a/src/mir_core/src/mir_core.def
+++ b/src/mir_core/src/mir_core.def
@@ -1074,3 +1074,4 @@ ProtoWindowAdd @1071 NONAME
ProtoWindowRemove @1072 NONAME
Proto_IsProtocolLoaded @1073 NONAME
Proto_RegisterModule @1074 NONAME
+?GetInst@CDlgBase@@QBEPAUHINSTANCE__@@XZ @1075 NONAME
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def
index 0308488cca..6c7513dbbe 100644
--- a/src/mir_core/src/mir_core64.def
+++ b/src/mir_core/src/mir_core64.def
@@ -1075,3 +1075,4 @@ ProtoWindowRemove @1072 NONAME
Proto_IsProtocolLoaded @1073 NONAME
Proto_RegisterModule @1074 NONAME
+?GetInst@CDlgBase@@QEBAPEAUHINSTANCE__@@XZ @1075 NONAME
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp
index 48d33deb80..a9975328c8 100644
--- a/src/modules/options/options.cpp
+++ b/src/modules/options/options.cpp
@@ -422,7 +422,7 @@ static LRESULT CALLBACK AeroPaintSubclassProc(HWND hwnd, UINT msg, WPARAM wParam
static void CALLBACK FilterSearchTimerFunc(HWND hwnd, UINT, UINT_PTR, DWORD)
{
- OptionsDlgData* dat = (OptionsDlgData*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ OptionsDlgData *dat = (OptionsDlgData*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (!dat)
return;
@@ -464,9 +464,10 @@ static void FillFilterCombo(HWND hDlg, OptionsDlgData* dat)
SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_SETITEMDATA, (WPARAM)index, (LPARAM)hInst);
for (int i = 0; i < dat->arOpd.getCount(); i++) {
- FindFilterStrings(FALSE, FALSE, hDlg, dat->arOpd[i]); // only modules name (fast enougth)
+ OptionsPageData *opd = dat->arOpd[i];
+ FindFilterStrings(FALSE, FALSE, hDlg, opd); // only modules name (fast enougth)
- HINSTANCE inst = dat->arOpd[i]->hInst;
+ HINSTANCE inst = opd->hInst;
if (inst == hInst)
continue;
@@ -710,7 +711,10 @@ static bool LoadOptionsPage(OPTIONSDIALOGPAGE *src, OptionsPageData *dst)
dst->dlgProc = src->pfnDlgProc;
dst->dwInitParam = src->dwInitParam;
}
- else dst->pDialog = src->pDialog;
+ else {
+ dst->hInst = src->pDialog->GetInst();
+ dst->pDialog = src->pDialog;
+ }
dst->hwnd = NULL;
dst->changed = 0;
@@ -1289,7 +1293,7 @@ static INT_PTR AddOptionsPage(WPARAM wParam, LPARAM lParam)
OptionsPageInit *opi = (OptionsPageInit*)wParam;
if (odp == NULL || opi == NULL) return 1;
- if (odp->cbSize != sizeof(OPTIONSDIALOGPAGE) && odp->cbSize != OPTIONPAGE_OLD_SIZE)
+ if (odp->cbSize != sizeof(OPTIONSDIALOGPAGE))
return 1;
opi->odp = (OPTIONSDIALOGPAGE*)mir_realloc(opi->odp, sizeof(OPTIONSDIALOGPAGE)*(opi->pageCount + 1));