diff options
author | George Hazan <george.hazan@gmail.com> | 2015-04-13 21:38:10 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-04-13 21:38:10 +0000 |
commit | d4dee7be1d5eab19b2cee2d94bd1671abd3446a3 (patch) | |
tree | 518ecf756c59c46e34831eb58a3eb2d2aea7a6eb /src/modules | |
parent | a58d37d39c039e755e5b902d5556fe34338130bc (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/modules')
-rw-r--r-- | src/modules/options/options.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
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));
|