⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 myie.cpp

📁 myie2.4版本的源代码
💻 CPP
📖 第 1 页 / 共 4 页
字号:
	//Exp width
	((CMainFrame*)m_pMainWnd)->m_nExpWidth = GetProfileInt("Settings", "ExpWidth", 200);

	//Exp Bar
	CString str = GetProfileString("Settings", "ExpBar");
	CString str1; 
	str1.LoadString(IDS_TITLE_SEARCH);
	if(str==str1)
		PostMessage(m_pMainWnd->m_hWnd, WM_COMMAND, ID_VIEW_EXPLOREBAR_SEARCH,0);
	str1.LoadString(IDS_TITLE_HIS);
	if(str==str1)
		PostMessage(m_pMainWnd->m_hWnd, WM_COMMAND, ID_VIEW_HIS,0);
	str1.LoadString(IDS_TITLE_FAVORITE);
	if(str==str1)
		PostMessage(m_pMainWnd->m_hWnd, WM_COMMAND, ID_FAVORITES_DROPDOWN,0);
	str1.LoadString(IDS_TITLE_SHELL);
	if(str==str1)
		PostMessage(m_pMainWnd->m_hWnd, WM_COMMAND, ID_VIEW_FOLDER,0);
	str1.LoadString(IDS_TITLE_RESOURCE);
	if(str==str1)
		PostMessage(m_pMainWnd->m_hWnd, WM_COMMAND, ID_VIEW_EXPLOREBAR_RESOURCE,0);

	//autosizing tab
	((CMainFrame*)m_pMainWnd)->m_bAutoTab = GetProfileInt("Settings", "AutoTab", 1);

	//max autosizing tab width
	((CMainFrame*)m_pMainWnd)->m_nMaxTabWidth = GetProfileInt("Settings", "MaxTabWidth", 72);
	//min autosizing tab width
	((CMainFrame*)m_pMainWnd)->m_nMinTabWidth = GetProfileInt("Settings", "MinTabWidth", 2);

	//confirm when exit
	bConfirmExit = GetProfileInt("Settings", "ConfirmExit", TRUE);

	//use shortcuts
	((CMainFrame*)m_pMainWnd)->m_bUseSC = GetProfileInt("Settings", "UseSC", FALSE);

	//use alias
	((CMainFrame*)m_pMainWnd)->m_bUseAlias = GetProfileInt("Settings", "UseAlias", TRUE);

	//load shortcuts
	char key[9] = "F";
	for(int i=0; i<11; i++)
	{
		itoa(i+2, key+1, 10);
		((CMainFrame*)m_pMainWnd)->m_strShortCuts[i] = GetProfileString("Shortcuts", key);
	}


	//load alias
	i=0; //int j;
	CString alias,url;
	r = TRUE;
	while(r)
	{
		key[0] = 'A';
		itoa(i, key+1, 10);
		alias = GetProfileString("Alias", key);
		if(alias=="" || alias.IsEmpty())
			r=FALSE;
		else
		{
			key[0] = 'U';
			itoa(i, key+1, 10);
			url = GetProfileString("Alias", key);
			if(url=="" || url.IsEmpty())
				r=FALSE;
			else
				((CMainFrame*)m_pMainWnd)->m_mapAlias.SetAt(alias, url);
		}
		i++;
	}

	//2.4 load quich search
	r = TRUE;
	i=0;
	TCHAR buf[1024];
	DWORD rlens;
	while(r)
	{
		key[0] = 'N';
		itoa(i, key+1, 10);
		rlens = ::GetPrivateProfileString("QuickSearch", key, _T(""), buf, 1024,
									  m_strQuickSearchPath);
		if(rlens==0)
			r=FALSE;
		else
		{
			alias = buf;
			key[0] = 'S';
			itoa(i, key+1, 10);
			rlens = ::GetPrivateProfileString("QuickSearch", key, _T(""), buf, 1024,
										  m_strQuickSearchPath);
			if(rlens==0)
				r=FALSE;
			else
			{
				url = buf;
				((CMainFrame*)m_pMainWnd)->m_QuickSearchMap.SetAt(alias, url);
			}
		}
		i++;
	}


	//Domains
	((CMainFrame*)m_pMainWnd)->m_strCE1 = GetProfileString("Domains", "CE1", "http://www.");
	((CMainFrame*)m_pMainWnd)->m_strCE2 = GetProfileString("Domains", "CE2", ".com");
	((CMainFrame*)m_pMainWnd)->m_strSE1 = GetProfileString("Domains", "SE1", "http://www.");
	((CMainFrame*)m_pMainWnd)->m_strSE2 = GetProfileString("Domains", "SE2", ".net");
	((CMainFrame*)m_pMainWnd)->m_strCSE1 = GetProfileString("Domains", "CSE1", "http://www.");
	((CMainFrame*)m_pMainWnd)->m_strCSE2 = GetProfileString("Domains", "CSE2", ".com.cn");

	//small to tray
	bSysTray = GetProfileInt("Settings", "SysTray", FALSE);

	//3721
	((CMainFrame*)m_pMainWnd)->m_bUse3721 = GetProfileInt("Settings", "Use3721", TRUE);

	//sequence
	((CMainFrame*)m_pMainWnd)->m_nSeq = GetProfileInt("Settings", "Sequence", 1);

	//silent
	bSilent = GetProfileInt("Settings", "Silent", TRUE);
	//default font size
	nDefFontSize = GetProfileInt("Settings", "DefFontSize", 2);
	//disable scroll text on status bar
	bURLOnly = GetProfileInt("Settings", "DisScrollText", FALSE);

	//filte blank popup window from same parent
	bFilteBlank = GetProfileInt("Settings", "FilteBlank", FALSE);

	//interval
	((CMainFrame*)m_pMainWnd)->m_nInterval = GetProfileInt("Settings", "Interval", 0);

	//open link in new window
//	bLinkInNewWin = GetProfileInt("Settings", "LinkInNewWin", 0);

	//browser mode
	((CMainFrame*)m_pMainWnd)->m_bmStandard.m_bActiveNewWindow = TRUE;
	((CMainFrame*)m_pMainWnd)->m_bmStandard.m_bAlwaysNewWindow = FALSE;
	((CMainFrame*)m_pMainWnd)->m_bmStandard.m_nSeq = 1;
	((CMainFrame*)m_pMainWnd)->m_bmStandard.bLinkInNewWin = FALSE;

	((CMainFrame*)m_pMainWnd)->m_bmNews.m_bActiveNewWindow = FALSE;
	((CMainFrame*)m_pMainWnd)->m_bmNews.m_bAlwaysNewWindow = TRUE;
	((CMainFrame*)m_pMainWnd)->m_bmNews.m_nSeq = 1;
	((CMainFrame*)m_pMainWnd)->m_bmNews.bLinkInNewWin = TRUE;

	((CMainFrame*)m_pMainWnd)->m_bmUserDefault.m_bActiveNewWindow = GetProfileInt("BModes", "ActiveNewWindow", ((CMainFrame*)m_pMainWnd)->m_bActiveNewWindow);
	((CMainFrame*)m_pMainWnd)->m_bmUserDefault.m_bAlwaysNewWindow = GetProfileInt("BModes", "AlwaysNewWindow", bAddressInNewWindow);
	((CMainFrame*)m_pMainWnd)->m_bmUserDefault.m_nSeq = GetProfileInt("BModes", "Seq", ((CMainFrame*)m_pMainWnd)->m_nSeq);
	((CMainFrame*)m_pMainWnd)->m_bmUserDefault.bLinkInNewWin = GetProfileInt("BModes", "LinkInNewWin", bLinkInNewWindow);

	//auto scroll
	((CMainFrame*)m_pMainWnd)->m_bDefScrollAfterDL = GetProfileInt("Settings", "AutoScrollAfterDL", TRUE);
	((CMainFrame*)m_pMainWnd)->m_bDefUseAutoScroll = GetProfileInt("Settings", "UseAutoScroll", FALSE);
	((CMainFrame*)m_pMainWnd)->m_nDefSrSpeed = GetProfileInt("Settings", "SrSpeed", 1);
	//scroll speed
	gSeed = (float)GetProfileInt("Settings", "SpeedSeed", 100);
	if(gSeed == 0)
		gSeed = 1;
	else
		gSeed = gSeed/100;

	bConfirmCloseAll = GetProfileInt("Settings", "ConfirmCloseAll", TRUE);


	//start group
	((CMainFrame*)m_pMainWnd)->m_strStartGroup = GetProfileString("Settings", "StartGroup", "");

	//new window
	((CMainFrame*)m_pMainWnd)->m_nNewWindow = GetProfileInt("Settings", "NewWindow", 0);

	//allow double click to close window
	((CMainFrame*)m_pMainWnd)->m_bAllowDBC = GetProfileInt("Settings", "AllowDBC", 1);

	//default bg color
	((CMainFrame*)m_pMainWnd)->m_strBGColor = GetProfileString("Settings", "BGColor", "#FFFFFF");

	//default auto refresh
	((CMainFrame*)m_pMainWnd)->m_nDefRefreshInterval = GetProfileInt("Settings", "AutoRefresh", 60);

	//security
	((CMainFrame*)m_pMainWnd)->m_bSecure = GetProfileInt("Settings", "Secure", FALSE);
}


void CMyIEApp::SaveConfg()
{
	//save popup list
	CString allpopups;
/*	
	POSITION pos = ((CMainFrame*)m_pMainWnd)->m_astrPopup.GetHeadPosition();
	UINT i=0;
	while(pos!=NULL)
	{
		allpopups += ((CMainFrame*)m_pMainWnd)->m_astrPopup.GetAt(pos);
		allpopups += "\n";
		((CMainFrame*)m_pMainWnd)->m_astrPopup.GetNext(pos);
	}
	WriteProfileBinary("Settings","Popups", (LPBYTE)allpopups.GetBuffer(1), allpopups.GetLength()+1);
*/
	try{

	UINT	i = 1;
	WriteProfileString("Popups", NULL, "");
	char Keyname[12] = "popup"; 
	POSITION pos = ((CMainFrame*)m_pMainWnd)->m_astrPopup.GetHeadPosition();
	while(pos!=NULL)
	{
		itoa(i, Keyname+5, 10);
		WriteProfileString("Popups", Keyname, ((CMainFrame*)m_pMainWnd)->m_astrPopup.GetAt(pos));
		((CMainFrame*)m_pMainWnd)->m_astrPopup.GetNext(pos);
		i++;
	}
	WriteProfileInt("Settings", "EnablePop", EnablePopupFilter);
	WriteProfileInt("Settings", "EnableDupFilter", EnableDupFilter);
	WriteProfileInt("Settings", "EnableAutoFilter", EnableAutoFilter);


	WriteProfileInt("Settings", "goHome", bGoHome);
	WriteProfileInt("Settings", "TabSize", ((CMainFrame*)m_pMainWnd)->m_nTitleLen);

	BYTE *tmp = NULL;
//	int cn;

	//=======================================Proxy=========================================
	((CMainFrame*)m_pMainWnd)->m_aProxyCategories.SaveProxies();

	//save web proxies
/*	allpopups.Empty();
	pos = ((CMainFrame*)m_pMainWnd)->m_astrWebProxy.GetHeadPosition();
	i=0;
	while(pos!=NULL)
	{
		allpopups += ((CMainFrame*)m_pMainWnd)->m_astrWebProxy.GetAt(pos);
		allpopups += "\n";
		((CMainFrame*)m_pMainWnd)->m_astrWebProxy.GetNext(pos);
	}
	WriteProfileBinary("Settings","WebProxy", (LPBYTE)allpopups.GetBuffer(1), allpopups.GetLength()+1);

  //save webproxy speed
	pos = ((CMainFrame*)m_pMainWnd)->m_aWebProxySpeed.GetHeadPosition();
	i=0;
	int cn = ((CMainFrame*)m_pMainWnd)->m_aWebProxySpeed.GetCount();
	if(cn>0)
		tmp = new BYTE[cn];
	while(pos!=NULL)
	{
		tmp[i] = ((CMainFrame*)m_pMainWnd)->m_aWebProxySpeed.GetAt(pos);
		((CMainFrame*)m_pMainWnd)->m_aWebProxySpeed.GetNext(pos);
		i++;
	}
	WriteProfileBinary("Settings","WebProxySP", tmp, cn);
	if(tmp!=NULL)
		delete tmp;
*/
	i = 1;
	char Keyname1[10]="wp", Keyname2[11]="wps", Keyname3[11]="wpn", Keyname4[11];
/*	WriteProfileString("WebProxy", NULL, "");
	pos = ((CMainFrame*)m_pMainWnd)->m_astrWebProxy.GetHeadPosition();
	while(pos!=NULL)
	{
		itoa(i, Keyname1+2, 10);
		WriteProfileString("WebProxy", Keyname1, ((CMainFrame*)m_pMainWnd)->m_astrWebProxy.GetAt(pos));
		((CMainFrame*)m_pMainWnd)->m_astrWebProxy.GetNext(pos);
		i++;
	}
	i = 1;
	pos = ((CMainFrame*)m_pMainWnd)->m_aWebProxySpeed.GetHeadPosition();
	while(pos!=NULL)
	{
		itoa(i, Keyname2+3, 10);
		WriteProfileInt("WebProxy", Keyname2, ((CMainFrame*)m_pMainWnd)->m_aWebProxySpeed.GetAt(pos));
		((CMainFrame*)m_pMainWnd)->m_aWebProxySpeed.GetNext(pos);
		i++;
	}
	i = 1;
	pos = ((CMainFrame*)m_pMainWnd)->m_astrWebProxyName.GetHeadPosition();
	while(pos!=NULL)
	{
		itoa(i, Keyname3+3, 10);
		WriteProfileString("WebProxy", Keyname3, ((CMainFrame*)m_pMainWnd)->m_astrWebProxyName.GetAt(pos));
		((CMainFrame*)m_pMainWnd)->m_astrWebProxyName.GetNext(pos);
		i++;
	}*/

	//save defaul web proxy
	WriteProfileString("Settings","DefaultWebProxy", ((CMainFrame*)m_pMainWnd)->m_strDefaultWebProxy);
	//save by pass
	WriteProfileString("Settings","ProxyByPass", ((CMainFrame*)m_pMainWnd)->m_strProxyByPass);
	//save proxy list
	WriteProfileInt("Settings","ProxyList", ((CMainFrame*)m_pMainWnd)->m_nCurProxyList);

//get current setting
/*2.0
	CString strCurProxy, bypass, user, pwd;
	if(((CMainFrame*)m_pMainWnd)->GetProxySetting(strCurProxy, bypass, user, pwd))
	{	//save the curproxy
		if(!((CMainFrame*)m_pMainWnd)->m_astrProxy.Find(strCurProxy))
		{
			((CMainFrame*)m_pMainWnd)->m_astrProxy.AddHead(strCurProxy);
			((CMainFrame*)m_pMainWnd)->m_aProxySpeed.AddHead(3);
//			((CMainFrame*)m_pMainWnd)->m_astrProxyUser.AddHead(user);
//			((CMainFrame*)m_pMainWnd)->m_astrProxyPwd.AddHead(pwd);
		}
	}

*/
	//save proxy servers
/*	allpopups.Empty();
	pos = ((CMainFrame*)m_pMainWnd)->m_astrProxy.GetHeadPosition();
	i=0;
	while(pos!=NULL)
	{
		allpopups += ((CMainFrame*)m_pMainWnd)->m_astrProxy.GetAt(pos);
		allpopups += "\n";
		((CMainFrame*)m_pMainWnd)->m_astrProxy.GetNext(pos);
	}
	WriteProfileBinary("Settings","Proxy", (LPBYTE)allpopups.GetBuffer(1), allpopups.GetLength()+1);
*/
	//save proxy users
/*	allpopups.Empty();
	pos = ((CMainFrame*)m_pMainWnd)->m_astrProxyUser.GetHeadPosition();
	i=0;
	while(pos!=NULL)
	{
		allpopups += ((CMainFrame*)m_pMainWnd)->m_astrProxyUser.GetAt(pos);
		allpopups += "\n";
		((CMainFrame*)m_pMainWnd)->m_astrProxyUser.GetNext(pos);
	}
	WriteProfileBinary("Settings","ProxyUser", (LPBYTE)allpopups.GetBuffer(1), allpopups.GetLength()+1);

	//save proxy servers password
	allpopups.Empty();
	pos = ((CMainFrame*)m_pMainWnd)->m_astrProxyPwd.GetHeadPosition();
	i=0;
	while(pos!=NULL)
	{
		allpopups += ((CMainFrame*)m_pMainWnd)->m_astrProxyPwd.GetAt(pos);
		allpopups += "\n";
		((CMainFrame*)m_pMainWnd)->m_astrProxyPwd.GetNext(pos);
	}
	WriteProfileBinary("Settings","ProxyPwd", (LPBYTE)allpopups.GetBuffer(1), allpopups.GetLength()+1);
*/
	//save proxy speed
/*	tmp = NULL;
	pos = ((CMainFrame*)m_pMainWnd)->m_aProxySpeed.GetHeadPosition();
	i=0;
	cn = ((CMainFrame*)m_pMainWnd)->m_aProxySpeed.GetCount();
	if(cn>0)
		tmp = new BYTE[cn];
	while(pos!=NULL)
	{
		tmp[i] = ((CMainFrame*)m_pMainWnd)->m_aProxySpeed.GetAt(pos);
		((CMainFrame*)m_pMainWnd)->m_aProxySpeed.GetNext(pos);
		i++;
	}
	WriteProfileBinary("Settings","ProxySP", tmp, cn);
	if(tmp!=NULL)
		delete tmp;
*/
/*2.3	i = 1;
	WriteProfileString("Proxy", NULL, "");
	Keyname1[0]='p'; Keyname2[0]='p'; Keyname2[1]='s'; Keyname3[0]='p'; Keyname3[1]='n';
	pos = ((CMainFrame*)m_pMainWnd)->m_astrProxy.GetHeadPosition();
	while(pos!=NULL)
	{
		itoa(i, Keyname1+1, 10);
		WriteProfileString("Proxy", Keyname1, ((CMainFrame*)m_pMainWnd)->m_astrProxy.GetAt(pos));
		((CMainFrame*)m_pMainWnd)->m_astrProxy.GetNext(pos);
		i++;
	}
	i = 1;
	pos = ((CMainFrame*)m_pMainWnd)->m_aProxySpeed.GetHeadPosition();
	while(pos!=NULL)
	{
		itoa(i, Keyname2+2, 10);
		WriteProfileInt("Proxy", Keyname2, ((CMainFrame*)m_pMainWnd)->m_aProxySpeed.GetAt(pos));
		((CMainFrame*)m_pMainWnd)->m_aProxySpeed.GetNext(pos);
		i++;
	}
	i = 1;
	pos = ((CMainFrame*)m_pMainWnd)->m_astrProxyName.GetHeadPosition();
	while(pos!=NULL)
	{
		itoa(i, Keyname3+2, 10);
		WriteProfileString("Proxy", Keyname3, ((CMainFrame*)m_pMainWnd)->m_astrProxyName.GetAt(pos));
		((CMainFrame*)m_pMainWnd)->m_astrProxyName.GetNext(pos);
		i++;
	}
*/
	//save defaul  proxy
	WriteProfileString("Settings","DefaultProxy", ((CMainFrame*)m_pMainWnd)->m_strCurProxy);

	//tab pos
	WriteProfileInt("Settings", "TabPos", m_bTopTab);

	//save utils names 
/*	allpopups.Empty();
	pos = ((CMainFrame*)m_pMainWnd)->m_lstrUtilNames.GetHeadPosition();
	i=0;
	while(pos!=NULL)
	{
		allpopups += ((CMainFrame*)m_pMainWnd)->m_lstrUtilNames.GetAt(pos);
		allpopups += "\n";
		((CMainFrame*)m_pMainWnd)->m_lstrUtilNames.GetNext(pos);
	}
	WriteProfileBinary("ExUtils","names", (LPBYTE)allpopups.GetBuffer(1), allpopups.GetLength()+1);
	//save utils commands
	allpopups.Empty();
	pos = ((CMainFrame*)m_pMainWnd)->m_lstrUtilCmds.GetHeadPosition();
	i=0;
	while(pos!=NULL)
	{
		allpopups += ((CMainFrame*)m_pMainWnd)->m_lstrUtilCmds.GetAt(pos);
		allpopups += "\n";
		((CMainFrame*)m_pMainWnd)->m_lstrUtilCmds.GetNext(pos);
	}
	WriteProfileBinary("ExUtils","cmds", (LPBYTE)allpopups.GetBuffer(1), allpopups.GetLength()+1);
*/
	i = 1;
	WriteProfileString("ExUtils", NULL, "");
	strcpy(Keyname1, "name"); 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -