if(pContext->type == MWContextBrowser && !EDT_IS_EDITOR(pContext))  { SHIST_CopySession(pNewContext, pContext); }
MWContext *CFE_CreateNewDocWindow(MWContext *pContext, URL_Struct *pURL)	{	if(pContext != NULL)	{		if(ABSTRACTCX(pContext)->IsDestroyed())	{			TRACE("Context %p Destroyed :: CreateNewDocWindow Blocking\n", pContext);			//	Don't allow this to happen if the context has been destroyed...			return(NULL);		}		MWContext *pRetval = ABSTRACTCX(pContext)->CreateNewDocWindow(pContext, pURL);		if(pRetval != NULL)	{			return(pRetval);		}	}	//	Regardless of the type of context we currently are, we are going to	//		create a new CMainFrame.	//	The contexts can do whatever they want in the derived class, but this is	//		the base implementation.  If they return a context, then we won't do this.	//	Cause a frame to open.	if(NULL == theApp.m_ViewTmplate->OpenDocumentFile(NULL))	{		return(NULL);	}	//	The new frame will be the last one in the application's frame list.	CMainFrame *pFrame;	CGenericFrame *pGenFrame;	for(pGenFrame = theApp.m_pFrameList; pGenFrame->m_pNext; pGenFrame = pGenFrame->m_pNext) {		/* No Body */;	}        pFrame = (CMainFrame *) pGenFrame;	MWContext *pNewContext = pFrame->GetMainContext()->GetContext();	//	Appropriate assignment of options/prefs can only happen if we are also	//		owned by a CMainFrame, check.	if(pContext != NULL) {		if (ABSTRACTCX(pContext)->IsFrameContext() && pContext->type == MWContextBrowser)	{		//	Assign over our options.		//	Toolbars...			LPNSTOOLBAR pIToolBar = NULL;			pFrame->GetChrome()->QueryInterface( IID_INSToolBar, (LPVOID *) &pIToolBar );			if ( pIToolBar ) {				pIToolBar->Release();			}			//	Directory buttons and location box and Default Encoding.			pFrame->GetChrome()->ShowToolbar(ID_LOCATION_TOOLBAR, pFrame->m_bLocationBar );			pFrame->m_iCSID = INTL_DefaultDocCharSetID(pContext);		}		//	Set the miscellaneous XP context properties.		pNewContext->fancyFTP = pContext->fancyFTP;			pNewContext->fancyNews = pContext->fancyNews;		//	Copy the session history over ONLY if called from a Browser        if(pContext->type == MWContextBrowser && !EDT_IS_EDITOR(pContext))  {		    SHIST_CopySession(pNewContext, pContext);        }	}	//	If there was no URL specified to load, load what's in the history.	//	Only take URLs from a browser window.	if(pURL == NULL)	{        //  Make sure we're coming from a context we understand, otherwise get out now.        if(pContext == NULL || EDT_IS_EDITOR(pContext) || pContext->type != MWContextBrowser)   {            //  In this case, load the home page.            pFrame->OnLoadHomePage();        }        else    {		    //	Load the oldest thing in it's history (most likely the home page).            //  This current entry was set above, all we have to do is go through            //      the motions of a reload.            ABSTRACTCX(pNewContext)->Reload();        }	}	else if(pURL != NULL)	{		//	Load the URL passed into this function.		ABSTRACTCX(pNewContext)->GetUrl(pURL, FO_CACHE_AND_PRESENT);	}    //	New frame window up, and filled out appropriately.	return(pNewContext);}