📄 extract.cpp
字号:
// extract.cpp : implementation file
//
#include "stdafx.h"
#include "lzw.h"
#include "extract.h"
#include "fz.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// extract dialog
extract::extract(CWnd* pParent /*=NULL*/)
: CDialog(extract::IDD, pParent)
{
//{{AFX_DATA_INIT(extract)
m_filepath1 = _T("");
m_filename1 = _T("");
m_filepath2 = _T("");
m_filename2 = _T("");
//}}AFX_DATA_INIT
}
void extract::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(extract)
DDX_Text(pDX, IDC_EDIT1, m_filepath1);
DDX_Text(pDX, IDC_EDIT2, m_filename1);
DDX_Text(pDX, IDC_EDIT3, m_filepath2);
DDX_Text(pDX, IDC_EDIT4, m_filename2);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(extract, CDialog)
//{{AFX_MSG_MAP(extract)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// extract message handlers
void extract::OnButton1()
{
// TODO: Add your control notification handler code here
char directory[100];
SHGetSpecialFolderPath(NULL, directory, CSIDL_DESKTOP, 0);
CFileDialog fd(TRUE, "pzc", NULL, OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST, "压缩文档(.pzc)|*.pzc|所有文件(*.*)|*.*||");
fd.m_ofn.lpstrInitialDir = directory;
if (fd.DoModal()==IDOK)
{
m_filepath1 = fd.GetPathName();
m_filename1 = fd.GetFileName();
UpdateData(FALSE);
}
}
void extract::OnButton2()
{
// TODO: Add your control notification handler code here
char directory[100];
SHGetSpecialFolderPath(NULL, directory, CSIDL_DESKTOP, 0);
CFileDialog fd(FALSE, "txt", NULL, OFN_CREATEPROMPT | OFN_OVERWRITEPROMPT, " 压缩文档(.txt)|*.txt|所有文件(*.*)|*.*||");
fd.m_ofn.lpstrInitialDir = directory;
if (fd.DoModal()==IDOK)
{
m_filepath2 = fd.GetPathName();
m_filename2 = fd.GetFileName();
UpdateData(FALSE);
}
}
void extract::OnOK()
{
// TODO: Add extra validation here
HASH2 hash[4098];
initial2(hash);
int n=getfilelen(m_filepath1);
char *ptr=readfile2(m_filepath1,n);
int *numfile=new int [n/3*2+3];
bitoperation(ptr,numfile,n);
n=(n%3) ? (n/3*2+1) : (n/3*2);
clear2(m_filepath2);
ext(hash,numfile,n,m_filepath2);
int j=MessageBox("完成!","Finish",MB_OK);
if (j==IDOK) CDialog::OnOK();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -