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

📄 userdata.cpp

📁 所有压缩格式的压缩解压缩。
💻 CPP
字号:
// UserData.cpp: implementation of the CUserData class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Compress.h"
#include "UserData.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CUserData::CUserData()
{

}

CUserData::~CUserData()
{

}

void CUserData::Load()
{
	CCompressApp *pApp=(CCompressApp*)AfxGetApp();
	
	char path[MAX_PATH],*p;
	GetModuleFileName(pApp->m_hInstance,path,MAX_PATH);
	p=path+lstrlen(path);
	while (*p!='\\') p--;
	p++;lstrcpy(p,"cdl");

	m_szCDLPath=pApp->GetProfileString("Settings","CdlPath",path);
	m_bShowDirectory=pApp->GetProfileInt("Settings","ShowDirectory",TRUE);
	m_ViewStyleID=pApp->GetProfileInt("Settings","ID_ViewStyle",ID_VIEW_LARGEICONS);
	m_TreeWidths[0]=pApp->GetProfileInt("TreeView","Column 0",100);
	m_TreeWidths[1]=pApp->GetProfileInt("TreeView","Column 1",70);
	m_TreeWidths[2]=pApp->GetProfileInt("TreeView","Column 2",60);
	m_TreeWidths[3]=pApp->GetProfileInt("TreeView","Column 3",60);
	m_TreeWidths[4]=pApp->GetProfileInt("TreeView","Column 4",40);
	m_TreeWidths[5]=pApp->GetProfileInt("TreeView","Column 5",30);
	m_TreeWidths[6]=pApp->GetProfileInt("TreeView","Column 6",20);
	m_TreeWidths[7]=pApp->GetProfileInt("TreeView","Column 7",120);

	m_WndPos.left=pApp->GetProfileInt("WindowPos","left",0);
	m_WndPos.right=pApp->GetProfileInt("WindowPos","right",600);
	m_WndPos.top=pApp->GetProfileInt("WindowPos","top",0);
	m_WndPos.bottom=pApp->GetProfileInt("WindowPos","bottom",400);
	m_ShowCmd=pApp->GetProfileInt("WindowPos","ShowCommand",SW_SHOWMAXIMIZED);
	if (m_ShowCmd==SW_SHOWMINIMIZED) m_ShowCmd=SW_SHOWMAXIMIZED;

	char tmp[MAX_PATH];
	GetTempPath(MAX_PATH,tmp);
	m_szTempPath=pApp->GetProfileString("Settings","TempPath",tmp);
}

void CUserData::Save()
{
	CCompressApp *pApp=(CCompressApp*)AfxGetApp();

	pApp->WriteProfileString("Settings","CdlPath",(LPCTSTR)m_szCDLPath);
	pApp->WriteProfileInt("Settings","ShowDirectory",m_bShowDirectory);
	pApp->WriteProfileInt("Settings","ID_ViewStyle",m_ViewStyleID);
	pApp->WriteProfileInt("TreeView","Column 0",m_TreeWidths[0]);
	pApp->WriteProfileInt("TreeView","Column 1",m_TreeWidths[1]);
	pApp->WriteProfileInt("TreeView","Column 2",m_TreeWidths[2]);
	pApp->WriteProfileInt("TreeView","Column 3",m_TreeWidths[3]);
	pApp->WriteProfileInt("TreeView","Column 4",m_TreeWidths[4]);
	pApp->WriteProfileInt("TreeView","Column 5",m_TreeWidths[5]);
	pApp->WriteProfileInt("TreeView","Column 6",m_TreeWidths[6]);
	pApp->WriteProfileInt("TreeView","Column 7",m_TreeWidths[7]);

	pApp->WriteProfileInt("WindowPos","left",m_WndPos.left);
	pApp->WriteProfileInt("WindowPos","right",m_WndPos.right);
	pApp->WriteProfileInt("WindowPos","top",m_WndPos.top);
	pApp->WriteProfileInt("WindowPos","bottom",m_WndPos.bottom);
	pApp->WriteProfileInt("WindowPos","ShowCommand",m_ShowCmd);

	pApp->WriteProfileString("Settings","TempPath",m_szTempPath);
}

⌨️ 快捷键说明

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