static void FillFilterCombo(HWND hDlg, OptionsDlgData* dat) { HINSTANCE *KnownInstances = (HINSTANCE*)alloca(sizeof(HINSTANCE)*dat->arOpd.getCount()); int countKnownInst = 0; SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_RESETCONTENT, 0, 0); int index = SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_ADDSTRING, 0, (LPARAM)TranslateT(ALL_MODULES_FILTER)); SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_SETITEMDATA, (WPARAM)index, 0); index = SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_ADDSTRING, 0, (LPARAM)TranslateT(CORE_MODULES_FILTER)); SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_SETITEMDATA, (WPARAM)index, (LPARAM)g_hInst); for (int i = 0; i < dat->arOpd.getCount(); i++) { OptionsPageData *opd = dat->arOpd[i]; FindFilterStrings(FALSE, FALSE, hDlg, opd); // only modules name (fast enougth) HINSTANCE inst = opd->getInst(); if (inst == g_hInst) continue; int j; for (j = 0; j < countKnownInst; j++) if (KnownInstances[j] == inst) break; if (j != countKnownInst) continue; KnownInstances[countKnownInst] = inst; countKnownInst++; TCHAR tszModuleName[MAX_PATH]; GetModuleFileName(inst, tszModuleName, _countof(tszModuleName)); TCHAR *dllName = mir_a2t(GetPluginNameByInstance(inst)); if (!dllName) dllName = mir_tstrdup(_tcsrchr(tszModuleName, _T('\\'))); if (!dllName) dllName = mir_tstrdup(tszModuleName); if (dllName) { index = SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_ADDSTRING, 0, (LPARAM)dllName); SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_SETITEMDATA, (WPARAM)index, (LPARAM)inst); mir_free(dllName); } } FilterLoadProgress = 100; }
static void FindFilterStrings(int enableKeywordFiltering, int current, HWND hWndParent, const OptionsPageData *page) { TCHAR pluginName[MAX_PATH]; HWND hWnd = 0; if (enableKeywordFiltering) { if (current) hWnd = page->hwnd; else { hWnd = CreateDialogIndirectParamA(page->hInst, page->pTemplate, hWndParent, page->dlgProc, page->dwInitParam); //create the options dialog page so we can parse it ShowWindow(hWnd, SW_HIDE); //make sure it's hidden } } DWORD key = GetPluginPageHash(page); //get the plugin page hash char *temp = GetPluginNameByInstance(page->hInst); GetDialogStrings(enableKeywordFiltering, key, GetPluginName(page->hInst, pluginName, SIZEOF(pluginName)), hWnd, page->ptszGroup, page->ptszTitle, page->ptszTab, _A2T(temp)); if (enableKeywordFiltering && !current) DestroyWindow(hWnd); //destroy the page, we're done with it }
static void FindFilterStrings(int enableKeywordFiltering, int current, HWND hWndParent, const OptionsPageData *page) { HWND hWnd = 0; if (enableKeywordFiltering) { if (current) hWnd = page->getHwnd(); else { hWnd = CreateOptionWindow(page, hWndParent); ShowWindow(hWnd, SW_HIDE); // make sure it's hidden } } DWORD key = GetPluginPageHash(page); // get the plugin page hash TCHAR pluginName[MAX_PATH]; char *temp = GetPluginNameByInstance(page->getInst()); GetDialogStrings(enableKeywordFiltering, key, GetPluginName(page->getInst(), pluginName, _countof(pluginName)), hWnd, page->ptszGroup, page->ptszTitle, page->ptszTab, _A2T(temp)); if (enableKeywordFiltering && !current) DestroyWindow(hWnd); // destroy the page, we're done with it }