亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? wizpageaction.cpp

?? zip的全部算法源代碼
?? CPP
字號:
/*************************************************************************
                     ZipALot
**************************************************************************

Copyright (C) December, 2000 Jean-Pierre Bergamin, james@ractive.ch

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
***************************************************************************/

// WizPage4.cpp : implementation file
//

#include "stdafx.h"
#include "zipalot.h"
#include "WizPageAction.h"
#include "WizSheet.h"
#include "DirectoryPicker.h"
#include "Unrar.h"
#include "Unzip.h"
#include "Unace.h"

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

extern BOOL Pump(HWND hWnd);

/////////////////////////////////////////////////////////////////////////////
// CWizPageAction property page

IMPLEMENT_DYNCREATE(CWizPageAction, CWizPage)

CWizPageAction::CWizPageAction() : CWizPage(CWizPageAction::IDD)
{
	//{{AFX_DATA_INIT(CWizPageAction)
	//}}AFX_DATA_INIT
	m_pTipDlg = NULL;
	m_psTempSource = NULL;
	m_psTempTarget = NULL;
	m_b2ndExtraction = FALSE;
	m_b3rdExtraction = FALSE;
}

CWizPageAction::~CWizPageAction()
{
}

void CWizPageAction::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CWizPageAction)
	DDX_Control(pDX, IDC_FILES, m_ActionCtrl);
	DDX_Control(pDX, IDC_WIZTIP, m_TipButton);
	//}}AFX_DATA_MAP
	tagWizData * pData = GetData();
	DDX_Text(pDX, IDC_WIZTARGET, pData->m_sInstallationDir);
}


BEGIN_MESSAGE_MAP(CWizPageAction, CPropertyPage)
	//{{AFX_MSG_MAP(CWizPageAction)
	ON_BN_CLICKED(IDC_WIZPICKSOURCE, OnWizPickSource)
	ON_BN_CLICKED(IDC_WIZTAKEACTION, OnDoIt)
	ON_NOTIFY(NM_CLICK, IDC_FILES, OnClickFiles)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CWizPageAction message handlers

BOOL CWizPageAction::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();

	tagWizData * pData = GetData();
	
	HICON hIcon = (HICON)LoadImage(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDI_CHANGEDIR), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
	if (hIcon) {
		((CButton *)GetDlgItem(IDC_WIZPICKSOURCE))->SetIcon(hIcon);
	}

	hIcon = (HICON)LoadImage(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDI_TIP), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
	if (hIcon) {
		m_TipButton.SetIcon(hIcon);
	}

	AddListHeaders();

	/*archiveType type = ((CWizSheet *)GetParent())->AnalyzeDirectory(*m_psTarget, m_sFilter.GetBuffer(_MAX_PATH));
	m_sFilter.ReleaseBuffer();

	AddAction(m_sFilter, "GAGA");*/

	// Set the new source
	//*m_psSource = *m_psTarget;

	//*m_psInstalledDir = *m_psGameDir;	
	pData->m_sInstallationDir = pData->m_sDefaultInstallDir;


	UpdateData(FALSE);

	//GetDlgItem(IDC_FILETYPE)->SetWindowText("Found archives: " + m_sFilter);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CWizPageAction::AddListHeaders()
{
	int nItem = 0;
	
	int nSubItem = 0;

	// Add the list control headers
	LV_COLUMN lvc;
	lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
	lvc.fmt = LVCFMT_LEFT;
	lvc.iSubItem = nSubItem++;
	lvc.cx = 140;
	lvc.pszText = _T("Filename");
	m_ActionCtrl.InsertColumn(0, &lvc);
	
	lvc.iSubItem = nSubItem++;
	lvc.cx = 100;
	lvc.pszText = _T("Action");
	m_ActionCtrl.InsertColumn(1, &lvc);

}

BOOL CWizPageAction::AddAction(LPCTSTR lpszFileName, LPCTSTR lpszAction)
{
	int nSubItem = 0;
	LVITEM item;
	item.mask = LVIF_TEXT;
	item.iItem = 0;
	item.iSubItem = nSubItem++;
	item.pszText = (LPTSTR)lpszFileName;
	int nRet = m_ActionCtrl.InsertItem(&item);
	if (nRet == -1) {
		return FALSE;
	}

	item.iItem = nRet;
	item.iSubItem = nSubItem++;
	item.pszText = (LPTSTR)lpszAction;
	return m_ActionCtrl.SetItem(&item) != -1;
}

BOOL CWizPageAction::OnSetActive() 
{
	tagWizData * pData = GetData();
	
	if (pData->m_psCurTarget->Right(1) != "\\") {
		*pData->m_psCurTarget += "\\";
	}

	if (m_ActionCtrl.GetItemCount() != 0) {
		if (m_psTempSource) {
			pData->m_psCurSource = m_psTempSource;
		}
		if (m_psTempTarget) {
			pData->m_psCurTarget = m_psTempTarget;				
		}
		((CPropertySheet *)GetParent())->SetWizardButtons(PSWIZB_NEXT | PSWIZB_BACK);
	}


	if (pData->m_sInstallationDir == pData->m_sDefaultInstallDir) {
		pData->m_sInstallationDir = pData->m_sDefaultInstallDir;
	}

	SetDlgItemText(IDC_WIZCURDIR, *pData->m_psCurTarget);

	CheckForFiles();

	((CPropertySheet *)GetParent())->SetWizardButtons(PSWIZB_BACK | PSWIZB_NEXT);

	m_TipButton.SetTipText(CreateTipText());

	return CPropertyPage::OnSetActive();
}

void CWizPageAction::OnWizPickSource() 
{
	tagWizData * pData = GetData();

	UpdateData();
	// Open a browse dialog
	CDirectoryPicker picker(m_hWnd, &pData->m_sInstallationDir);
	UpdateData(FALSE);
	
}

void CWizPageAction::CheckForFiles()
{
	CWaitCursor wait;

	tagWizData * pData = GetData();

	CFileFind finder;

	m_ActionCtrl.DeleteAllItems();
	
	if (pData->m_psCurTarget->Right(1) != "\\") {
		*pData->m_psCurTarget += "\\";
	}

	BOOL bFound = finder.FindFile(*pData->m_psCurTarget + "*.ace");
	while (bFound) {
		bFound = finder.FindNextFile();
		AddAction(finder.GetFileName(), "Unace");
	}

	finder.Close();
	
	bFound = finder.FindFile(*pData->m_psCurTarget + "*.rar");
	while (bFound) {
		bFound = finder.FindNextFile();
		AddAction(finder.GetFileName(), "Unrar");
	}

	bFound = finder.FindFile(*pData->m_psCurTarget + "*.zip");
	while (bFound) {
		bFound = finder.FindNextFile();
		AddAction(finder.GetFileName(), "Unzip");
	}


	bFound = finder.FindFile(*pData->m_psCurTarget + "*.exe");
	while (bFound) {
		bFound = finder.FindNextFile();
		// Test if these are self extraction archives...
		CUnzip unzipper(this); unzipper.Init();
		CUnace unace(this); unace.Init();
		CUnrar unrar(this); unrar.Init();
		if (unzipper.IsArchive(finder.GetFilePath())) {
			AddAction(finder.GetFileName(), "Unzip");
		}
		else if (unace.IsArchive(finder.GetFilePath())) {
			AddAction(finder.GetFileName(), "Unace");
		}
		else if (unrar.IsArchive(finder.GetFilePath())) {
			AddAction(finder.GetFileName(), "Unrar");
		}
		else {
			AddAction(finder.GetFileName(), "Execute");
		}
	}

	bFound = finder.FindFile(*pData->m_psCurTarget + "*.bat");
	while (bFound) {
		bFound = finder.FindNextFile();
		AddAction(finder.GetFileName(), "Execute");
	}
	bFound = finder.FindFile(*pData->m_psCurTarget + "*.reg");
	while (bFound) {
		bFound = finder.FindNextFile();
		AddAction(finder.GetFileName(), "Execute");
	}

	pData->m_Error = EX_OK;
}

void CWizPageAction::OnClickFiles(NMHDR* pNMHDR, LRESULT* pResult) 
{
	tagWizData * pData = GetData();


	NMLISTVIEW* pNMListView = (NM_LISTVIEW *)pNMHDR;
	if (m_ActionCtrl.HitTest(pNMListView->ptAction) == -1) {
		// The doubleclick was not on an item. Nothing to do!
		return;
	}
	// Get the entry from the data field.
	CString sAction = m_ActionCtrl.GetItemText(pNMListView->iItem, 1);
	if (sAction == "Execute") {
		((CEdit *)GetDlgItem(IDC_WIZTARGET))->SetReadOnly(TRUE);
		GetDlgItem(IDC_WIZPICKSOURCE)->ModifyStyle(0, WS_DISABLED);
		SetDlgItemText(IDC_WIZTAKEACTION, sAction);
	}
	else {
		((CEdit *)GetDlgItem(IDC_WIZTARGET))->SetReadOnly(FALSE);
		GetDlgItem(IDC_WIZPICKSOURCE)->ModifyStyle(WS_DISABLED, 0);
		pData->m_sExtractFilter = m_ActionCtrl.GetItemText(pNMListView->iItem, 0);
		CString sNewTarget = pData->m_sInstallationDir;
		if (sNewTarget.Right(1) != "\\") {
			sNewTarget += "\\";
		}
		if (pData->m_sInstallationDir == pData->m_sDefaultInstallDir) {
			sNewTarget += pData->m_sExtractFilter.Left(pData->m_sExtractFilter.ReverseFind('.'));
		}
		
		GetDlgItem(IDC_WIZTARGET)->SetWindowText(sNewTarget);
		SetDlgItemText(IDC_WIZTAKEACTION, sAction);
	}

	InvalidateRect(NULL);
	UpdateWindow();

	*pResult = 0;
}

LRESULT CWizPageAction::OnWizardNext() 
{
	if (!m_b3rdExtraction && m_b2ndExtraction) {
		tagWizData * pData = GetData();
		pData->m_psCurTarget = &pData->m_sInstallationDir;
		SetDlgItemText(IDC_WIZCURDIR, *pData->m_psCurTarget);
		CheckForFiles();
		if (m_ActionCtrl.GetItemCount() == 0) {
			// If there were no files found, go to the end
			((CPropertySheet *)GetParent())->SetActivePage(WIZ_END);
		}
		m_TipButton.SetTipText(CreateTipText());
		return -1;
	}
	return CPropertyPage::OnWizardNext();
}

LRESULT CWizPageAction::OnWizardBack() 
{
	return CPropertyPage::OnWizardBack();
}

void CWizPageAction::OnDoIt()
{
	tagWizData * pData = GetData();

	UpdateData();

	POSITION pos = m_ActionCtrl.GetFirstSelectedItemPosition();	
	if (pos) {
		int nItem = m_ActionCtrl.GetNextSelectedItem(pos);
		UpdateData();
		CString sAction = m_ActionCtrl.GetItemText(nItem, 1);
		if (sAction == "Unace" || sAction == "Unrar" || sAction == "Unzip") {
			m_psTempSource = pData->m_psCurSource;
			m_psTempTarget = pData->m_psCurTarget;

			pData->m_sExtractFilter = m_ActionCtrl.GetItemText(nItem, 0);
			pData->m_psCurSource = pData->m_psCurTarget;
			pData->m_psCurTarget = &pData->m_sInstallationDir;
			pData->m_nNextPage = ((CPropertySheet *)GetParent())->GetActiveIndex();
			((CPropertySheet *)GetParent())->SetActivePage(WIZ_UNZIP);
			if (m_b2ndExtraction) {
				m_b3rdExtraction = TRUE;
			}
			m_b2ndExtraction = TRUE;
		}
		else if (sAction == "Execute") {
			((CPropertySheet *)GetParent())->SetWizardButtons(0);

			CString sFile = *pData->m_psCurTarget;
			if (sFile.Right(1) != "\\") {
				sFile += "\\";
			}
			sFile += m_ActionCtrl.GetItemText(nItem, 0);
			if (sFile.Right(3).CompareNoCase("reg") == 0) {
				ShellExecute(m_hWnd, "open", sFile, NULL, NULL, SW_NORMAL);
			}
			else {
				STARTUPINFO sui = {0};
				sui.cb = sizeof(sui);
				sui.lpReserved = NULL;
				sui.lpReserved2 = NULL;
				sui.lpDesktop = NULL;
				sui.lpTitle = NULL;
				PROCESS_INFORMATION pi;
				if (CreateProcess(sFile, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NORMAL_PRIORITY_CLASS, NULL, *pData->m_psCurTarget, &sui, &pi)) {
					while(WaitForSingleObject(pi.hProcess, 500) != WAIT_OBJECT_0) {
						Pump(m_hWnd);
					}
					DWORD dwReturn;
					GetExitCodeProcess(pi.hProcess, &dwReturn);
				}
				sFile = m_ActionCtrl.GetItemText(nItem, 0);
				if (sFile.CompareNoCase("install.exe") == 0 || sFile.CompareNoCase("setup.exe") == 0) {
					MessageBox("Where did you install the application?\r\n\r\nPlease choose the path...", "Installation directory", MB_OK | MB_ICONQUESTION);
					OnWizPickSource();
				}
				if (m_b2ndExtraction) {
					m_b3rdExtraction = TRUE;
				}
				m_b2ndExtraction = TRUE;
			}
		}
	}

	((CPropertySheet *)GetParent())->SetWizardButtons(PSWIZB_NEXT | PSWIZB_BACK);
}

CString CWizPageAction::CreateTipText()
{
	tagWizData * pData = GetData();

	CString sTipText;
	CString sFile, sAction;
	for(int i = 0; i < m_ActionCtrl.GetItemCount(); i++) {
		sFile = m_ActionCtrl.GetItemText(i, 0);
		sAction = m_ActionCtrl.GetItemText(i, 1);
		
		if (sFile.CompareNoCase("install.exe") == 0 || sFile.CompareNoCase("setup.exe") == 0) {
			sTipText += "- Run " + sFile + " to install the program\r\n";
		}
		
		if (sFile.CompareNoCase("setup.bat") == 0) {
			sTipText += "- " + sFile + " probably unpacks some stuff\r\n        >>> Run it!\r\n";
		}
		else if (sFile.CompareNoCase("unpack.exe") == 0) {
			sTipText += "- " + sFile + " probably unpacks some stuff\r\n        >>> Run it!\r\n";
		}

		if (sFile.CompareNoCase("regsetup.exe") == 0 || sFile.CompareNoCase("setupreg.exe") == 0) {
			sTipText += "- " + sFile + " adds informations to the registry\r\n        >>> Run it!\r\n";
		}

		CString sExt = sFile.Right(sFile.GetLength() - sFile.ReverseFind('.') - 1);
		if (sExt.CompareNoCase("ace") == 0 || sExt.CompareNoCase("rar") == 0) {
			CFileFind finder;

			BOOL bFind = finder.FindFile(*pData->m_psCurTarget + sFile.Left(sFile.ReverseFind('.')) + "*");
			int nFiles = 0;
			while(bFind) {
				bFind = finder.FindNextFile();
				nFiles++;
				if (nFiles > 2) {
					break;
				}
			}
			finder.Close();

			if (nFiles > 2) {
				sTipText += "- " + sFile + " seems to be the main archive.\r\n        >>> Extract it\r\n";
			}
			else {
				sTipText += "- " + sFile + " is a single archive; probably a crack\r\n        >>> Extract it to the installation dir\r\n";
			}
		}
		else if (sExt.CompareNoCase("exe") == 0) {
			if (sAction == "Unace" || sAction == "Unrar" || sAction == "Unzip") {
				sTipText += "- " + sFile + " is a selfextracting Archive.\r\n        >>> Extract it\r\n";
			}
		}
		else if (sExt.CompareNoCase("reg") == 0) {
			sTipText += "- " + sFile + " contains registry information.\r\n        >>> Run it\r\n";
		}

	}
	CFileFind finder;
	
	return sTipText;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久亚洲一区二区三区四区| 色婷婷久久综合| 欧美电影免费观看高清完整版在 | www.欧美色图| 国产欧美综合在线观看第十页| 国产精品99久久久久久有的能看| 久久蜜桃香蕉精品一区二区三区| 国产成人av电影在线| 中文字幕中文字幕一区| 欧美日韩中文一区| 久久aⅴ国产欧美74aaa| 日本一区二区免费在线| 色综合天天天天做夜夜夜夜做| 亚洲自拍另类综合| 日韩免费性生活视频播放| 国产精品1区二区.| 日韩一区日韩二区| 6080日韩午夜伦伦午夜伦| 亚洲制服欧美中文字幕中文字幕| 欧美一区二区三区免费视频| 日韩毛片精品高清免费| 欧美日韩亚洲综合在线| 精品在线播放午夜| 亚洲欧洲成人自拍| 51久久夜色精品国产麻豆| 国产乱淫av一区二区三区| 中文字幕在线视频一区| 欧美精品在线一区二区| 从欧美一区二区三区| 亚洲精品高清视频在线观看| 日韩亚洲欧美在线| 91日韩精品一区| 六月丁香婷婷色狠狠久久| 亚洲三级电影网站| 精品精品国产高清a毛片牛牛| 99久久精品国产毛片| 老色鬼精品视频在线观看播放| 中文字幕一区二区三中文字幕| 91精品国产91综合久久蜜臀| 91色视频在线| 国产东北露脸精品视频| 爽好久久久欧美精品| 自拍av一区二区三区| 久久色在线视频| 欧美精品 日韩| 色综合视频一区二区三区高清| 久久er99热精品一区二区| 樱花草国产18久久久久| 国产日韩视频一区二区三区| 欧美一区二区三区在线观看| 一本一道久久a久久精品| 国产黑丝在线一区二区三区| 奇米影视一区二区三区小说| 中文字幕制服丝袜一区二区三区| 久久美女艺术照精彩视频福利播放| 欧美午夜寂寞影院| 色噜噜久久综合| 成人一区在线观看| 国产一区二区三区久久久| 日本美女一区二区| 视频一区欧美日韩| 亚洲妇女屁股眼交7| 中文字幕一区不卡| 国产精品无码永久免费888| 精品免费99久久| 欧美sm极限捆绑bd| 日韩女优毛片在线| 91精品国产丝袜白色高跟鞋| 欧美猛男男办公室激情| 在线精品视频免费观看| 成人小视频在线观看| 国产精品996| 免费观看91视频大全| 亚洲国产精品久久人人爱| 一区二区三区加勒比av| 一区二区三区中文字幕电影 | 欧美精选在线播放| 精品视频999| 欧美日韩成人一区| 欧美日韩免费观看一区三区| 欧美高清视频一二三区| 91麻豆精品91久久久久久清纯| 欧美日韩免费一区二区三区视频| 欧美日韩精品免费观看视频 | 91黄色免费版| 欧美三级一区二区| 9191国产精品| 26uuu国产一区二区三区| 欧美电影免费观看高清完整版在线 | 国产一区二区三区免费看 | 99久久婷婷国产综合精品| 91色porny蝌蚪| 欧美日韩精品是欧美日韩精品| 欧美猛男男办公室激情| 精品日韩一区二区三区 | 91丝袜呻吟高潮美腿白嫩在线观看| 成人美女视频在线观看| 日本道色综合久久| 欧美日韩成人一区| 久久蜜桃一区二区| 亚洲免费高清视频在线| 午夜精品久久久久久不卡8050| 日本aⅴ免费视频一区二区三区| 国产一区二区剧情av在线| av亚洲精华国产精华精华| 91黄色免费网站| 精品久久久久久久久久久久久久久| 国产欧美一区二区精品秋霞影院| 亚洲精品视频免费看| 免费观看一级特黄欧美大片| 成人免费va视频| 在线不卡一区二区| 日本一区二区三区在线不卡| 亚洲影视在线播放| 国产一区二区三区蝌蚪| 欧美在线观看一区| 国产片一区二区| 日韩av在线播放中文字幕| 成人h动漫精品| 欧美成人伊人久久综合网| 亚洲乱码国产乱码精品精小说 | av日韩在线网站| 日韩欧美综合在线| 亚洲免费资源在线播放| 极品美女销魂一区二区三区 | 久久亚洲一区二区三区四区| 亚洲精品亚洲人成人网在线播放| 久久99精品国产.久久久久久| 日本精品视频一区二区三区| 精品国产百合女同互慰| 亚洲一区二区黄色| 丁香一区二区三区| 欧美成人综合网站| 午夜精品久久久久久久久久久 | 国产女人18毛片水真多成人如厕 | 欧美精品一二三四| 亚洲天堂网中文字| 国产精品综合视频| 欧美一区二区三区影视| 一区二区三区免费在线观看| 国产成人在线免费观看| 欧美一级免费大片| 亚洲综合免费观看高清完整版在线| 国产高清在线精品| 久久日一线二线三线suv| 丝袜美腿亚洲色图| 欧美午夜一区二区| 亚洲精品国产高清久久伦理二区| 成人一区二区三区中文字幕| 久久久亚洲综合| 久久99国产精品久久99| 欧美日韩激情一区| 亚洲国产精品久久人人爱蜜臀| 97国产一区二区| 中文字幕一区二区不卡| 成人激情动漫在线观看| 国产欧美精品区一区二区三区| 国产一区二区三区免费观看| 久久综合狠狠综合| 久久国产精品一区二区| 欧美mv日韩mv国产网站app| 日韩国产在线观看| 欧美一区二区在线不卡| 青青青爽久久午夜综合久久午夜| 欧美日韩一区二区电影| 亚洲成人三级小说| 精品视频999| 琪琪久久久久日韩精品| 欧美精品高清视频| 日韩和欧美一区二区| 日韩一级高清毛片| 黄色资源网久久资源365| 国产日韩欧美在线一区| av在线不卡电影| 一区二区在线观看视频| 在线欧美日韩国产| 亚洲国产va精品久久久不卡综合| 欧美日韩电影一区| 免费在线观看一区| 精品国产成人系列| 懂色av一区二区夜夜嗨| 亚洲欧美日韩国产一区二区三区 | 国产精品99久久不卡二区| 国产日韩欧美综合在线| 99re在线精品| 亚洲综合一区在线| 717成人午夜免费福利电影| 美女视频一区二区三区| 国产亚洲综合av| 色婷婷亚洲综合| 奇米色一区二区三区四区| 久久久亚洲午夜电影| 一本色道久久综合精品竹菊| 亚洲成av人在线观看| 欧美成人福利视频| jvid福利写真一区二区三区| 亚洲一区二区三区视频在线 | 中文字幕在线不卡一区二区三区 | 91影视在线播放| 免费成人结看片|