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

📄 hxtdlg.cpp

📁 目录快捷压缩
💻 CPP
字号:
// hxtDlg.cpp : 实现文件
//

#include "stdafx.h"
#include "hxt.h"
#include "hxtDlg.h"
#include ".\hxtdlg.h"
#include "czip.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

// ChxtDlg 对话框
char Set_ExpandDir[MAX_PATH]="\0";
int  m_TatolCreateFileNum=0;
struct FILE_HEAD_STRUCT{
	char strFilePathName[MAX_PATH];
	DWORD dwSize;
};
FILE_HEAD_STRUCT FileHeadData[1024];

CString strTmpPath;
int	 CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
{
	TCHAR szDir[MAX_PATH];
	switch(uMsg){
		case BFFM_INITIALIZED:
			if (lpData){
				strcpy(szDir, strTmpPath.GetBuffer(strTmpPath.GetLength()));
				SendMessage(hwnd,BFFM_SETSELECTION,TRUE,(LPARAM)szDir);
			}
			break;
		case BFFM_SELCHANGED: 
			{
				if (SHGetPathFromIDList((LPITEMIDLIST) lParam ,szDir)){
					SendMessage(hwnd,BFFM_SETSTATUSTEXT,0,(LPARAM)szDir);
				}
				break;
			}
		default:
			break;
	}
	return 0;
}
BOOL GetFolder(CString* strSelectedFolder,const char* lpszTitle,const HWND hwndOwner,const char* strRootFolder,const char* strStartFolder)
{
	char pszDisplayName[MAX_PATH];
	LPITEMIDLIST lpID;
	BROWSEINFOA bi;

	bi.hwndOwner = hwndOwner;
	if (strRootFolder == NULL){
		bi.pidlRoot = NULL;
	}else{
		LPITEMIDLIST  pIdl = NULL;
		IShellFolder* pDesktopFolder;
		char          szPath[MAX_PATH];
		OLECHAR       olePath[MAX_PATH];
		ULONG         chEaten;
		ULONG         dwAttributes;

		strcpy(szPath, (LPCTSTR)strRootFolder);
		if (SUCCEEDED(SHGetDesktopFolder(&pDesktopFolder)))
		{
			MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, szPath, -1, olePath, MAX_PATH);
			pDesktopFolder->ParseDisplayName(NULL, NULL, olePath, &chEaten, &pIdl, &dwAttributes);
			pDesktopFolder->Release();
		}
		bi.pidlRoot = pIdl;
	}
	bi.pszDisplayName = pszDisplayName;
	bi.lpszTitle = lpszTitle;
	bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT;
	bi.lpfn = BrowseCallbackProc;
	if (strStartFolder == NULL){
		bi.lParam = FALSE;
	}else{
		strTmpPath.Format("%s", strStartFolder);
		bi.lParam = TRUE;
	}
	bi.iImage = NULL;
	lpID = SHBrowseForFolderA(&bi);
	if (lpID != NULL){
		BOOL b = SHGetPathFromIDList(lpID, pszDisplayName);
		if (b == TRUE){
			strSelectedFolder->Format("%s",pszDisplayName);
			return TRUE;
		}
	}else{
		strSelectedFolder->Empty();
	}
	return FALSE;
}
void DnyCreateDirectory(char *strDirector)
{
	////////首先判断该目录是否已经存在
	char strTest[MAX_PATH];
	sprintf(strTest,"%s\\test.est",strDirector);
	FILE *hTest;
	hTest=fopen(strTest,"wb");
	if(NULL==hTest)
	{
		BOOL bRet=CreateDirectory(strDirector, NULL); 
		if(!bRet)
		{
			char strCurrentDirector[MAX_PATH];
			strcpy(strCurrentDirector,strDirector);
			char strPreDirector[MAX_PATH];
			strcpy(strPreDirector,strCurrentDirector);
			char *pStr=strrchr(strPreDirector,'\\');
			*pStr='\0';
			DnyCreateDirectory(strPreDirector);
			CreateDirectory(strCurrentDirector, NULL); 
		}
	}else{
		fclose(hTest);
		DeleteFile(strTest);
	}
}



////////////////////////////////////////////////////////////////////

ChxtDlg::ChxtDlg(CWnd* pParent /*=NULL*/)
	: CDialog(ChxtDlg::IDD, pParent)
	, m_sPassword(_T(""))
	, m_bState(true)
	, m_iLength(0)
	, m_sZhaohang(_T("谰蝎整佑恬掭经事侏佑"))
	, m_sJianHang(_T("=999=78:87779@:9@=7"))
	, m_sHuMing(_T("夹迎

⌨️ 快捷键说明

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