ReloadAllWindows();
wfe_ReloadAllWindows();
wfe_DisplayPreferences(CGenericFrame *pFrame){	HINSTANCE					 	hPrefDll;	LPSPECIFYPROPERTYPAGEOBJECTS	categories[7];	PFNPREFS					 	pfnCreatePropertyFrame;	ULONG						 	nCategories = 0;	ULONG						 	nInitialCategory;    ULONG                           nDesktopCategory = -1;	MWContext	  				   *pContext = pFrame ? pFrame->GetMainContext()->GetContext() : NULL;	static CGenericFrame		   *pCurrentFrame = NULL;	// We only allow one pref UI window up at a time	if (pCurrentFrame) {		HWND	hwnd = ::GetLastActivePopup(pCurrentFrame->m_hWnd);#ifdef _WIN32		::SetForegroundWindow(hwnd);#else		::BringWindowToTop(hwnd);#endif		return;	}	// Load the preferences UI DLL#ifdef _WIN32	hPrefDll = LoadLibrary("prefui32.dll");	if (hPrefDll) {#else	hPrefDll = LoadLibrary("prefui16.dll");	if ((UINT)hPrefDll > 32) {#endif		// Get the address of the routine to create the property frame		pfnCreatePropertyFrame = (PFNPREFS)GetProcAddress(hPrefDll, "NS_CreatePropertyFrame");		if (!pfnCreatePropertyFrame) {#ifdef _DEBUG            const char * const pText = "Unable to get proc address for NS_CreatePropertyFrame";            if ( pFrame ) {    			pFrame->MessageBox( pText, NULL, MB_OK | MB_ICONEXCLAMATION);            } else {                AfxMessageBox( pText, MB_OK | MB_ICONEXCLAMATION );            }#endif			FreeLibrary(hPrefDll);			return;		}				// Remember that this window is displaying the pref UI		pCurrentFrame = pFrame;		// Appearances category		if (CreateAppearancesCategory(pFrame, &categories[nCategories]))			nCategories++;		// Browser category		if (CreateBrowserCategory(pContext, &categories[nCategories]))			nCategories++;#ifdef MOZ_MAIL_NEWS		// Mail and News category        CStubsCX *pStubCX = NULL; // Stub to use if we don't have a context.        // Get stub CX if we need it.        if ( !pContext ) {            pStubCX = new CStubsCX();        }		if (CreateMailNewsCategory(pContext ? pContext : pStubCX->GetContext(), &categories[nCategories]))			nCategories++;        // Free stub CX if we created one.        if ( pStubCX ) {            delete pStubCX;        }#endif // MOZ_MAIL_NEWS#ifdef MOZ_LOC_INDEP		// LI category		if (CreateLICategory(&categories[nCategories]))			nCategories++;#endif // MOZ_LOC_INDEP		#ifdef EDITOR				// Editor category		if (SUCCEEDED(FEU_CoCreateInstance(CLSID_EditorPrefs,			                           NULL,									   CLSCTX_INPROC_SERVER,									   IID_ISpecifyPropertyPageObjects,									   (LPVOID *)&categories[nCategories]))) {			nCategories++;		}#endif EDITOR#ifdef MOZ_OFFLINE		// Offline category		if (CreateOfflineCategory(&categories[nCategories]))			nCategories++;#endif // MOZ_OFFLINE				// Advanced category        if (CreateAdvancedCategory(pContext, &categories[nCategories])) {			nCategories++;		}        // Windows Desktop Integration category.        if (SUCCEEDED(FEU_CoCreateInstance(CLSID_WindowsPrefs,                                           NULL,                                           CLSCTX_INPROC_SERVER,                                           IID_ISpecifyPropertyPageObjects,                                           (LPVOID *)&categories[nCategories]))) {            nDesktopCategory = nCategories++;        } else {            // Register DLL and try again.            RegisterCLSIDForDll( "winpref.dll" );            if (SUCCEEDED(FEU_CoCreateInstance(CLSID_WindowsPrefs,                                               NULL,                                               CLSCTX_INPROC_SERVER,                                               IID_ISpecifyPropertyPageObjects,                                               (LPVOID *)&categories[nCategories]))) {                nDesktopCategory = nCategories++;            }        }                     // Make sure we have at least one category		if (nCategories == 0) {            if ( pFrame ) {                pFrame->MessageBox(szLoadString(IDS_CANT_LOAD_PREFS), NULL, MB_OK | MB_ICONEXCLAMATION);            } else {                AfxMessageBox(szLoadString(IDS_CANT_LOAD_PREFS), MB_OK | MB_ICONEXCLAMATION);            }			FreeLibrary(hPrefDll);			return;		}		        // Hack to indicate whether we need to reload the windows because something		// like a color or a font changed		//		// We do have code that observes the XP prefs, but if more than one preference		// changes we'll get several callbacks (we don't have a way to do batch changes)		// and we'll reload the windows multiple times which is very sloppy...		g_bReloadAllWindows = FALSE;		// Figure out what the initial category we display should be		if (pFrame && pFrame->IsEditFrame()) {			nInitialCategory = 3;        } else if ( !pContext && !theApp.m_bShowPrefsOnStartup && nDesktopCategory!=-1 ) {            nInitialCategory = nDesktopCategory;		} else if (pContext && (pContext->type == MWContextMail ||				 pContext->type == MWContextMailMsg ||				 pContext->type == MWContextMessageComposition ||				 pContext->type == MWContextAddressBook)) {			nInitialCategory = 2;		} else {			nInitialCategory = 1;		}				// Display the preferences		pfnCreatePropertyFrame(pFrame ? pFrame->m_hWnd : NULL, -1, -1, "Preferences", nCategories, categories,            nInitialCategory, NetHelpWrapper);		pCurrentFrame = NULL;		// Release the interface pointers for the preference categories		for (ULONG i = 0; i < nCategories; i++)			categories[i]->Release();		// Unload the library		FreeLibrary(hPrefDll);		// See if we need to reload the windows		if (g_bReloadAllWindows) {			ReloadAllWindows();			g_bReloadAllWindows = FALSE;		}		// Save out the preferences		PREF_SavePrefFile();	} else {#ifdef _DEBUG		MessageBox(NULL, "Unable to load NSPREFUI.DLL", "Navigator",			MB_OK | MB_ICONEXCLAMATION);#endif	}}