Example #1
0
bool CFileListView::OnDropFiles( HDROP hDrop )
{
	char szFileName[MAX_PATH];
	char szPath[MAX_PATH] = {0};
	UInt32 nTotalCount;

	if(m_pArchive == NULL)
	{
		DragQueryFile(hDrop, 0, szFileName, MAX_PATH);
		OpenArchive(szFileName);
	}
	else
	{
		if(m_FileStack.size() > 1)
			GetCurrentPath(szPath,MAX_PATH);

		ProgressDlg progDlg;
		progDlg.SetArchiveHandle(m_pArchive);
		progDlg.SetCompression(m_nCompression);
		progDlg.AddToDir(szPath);

		nTotalCount = DragQueryFile(hDrop, -1, NULL, 0);
		for (UInt32 i = 0; i < nTotalCount; ++i)
		{
			DragQueryFile(hDrop, i, szFileName, MAX_PATH);
			progDlg.AddFile(szFileName);
		}

		progDlg.Exec(this);

		RefreshFileList();
		ShowFileList(szPath);
	}

	DragFinish(hDrop);

	return true;
}
Example #2
0
bool CFileListView::OpenArchive( const char* pFileName )
{
	CloseArchive();

	m_pArchive = archive_open(pFileName,0);
	if(m_pArchive == NULL)
	{
		ErrotTip();
		return false;
	}

	if(m_pParent != NULL)
	{
		char szTitle[MAX_PATH];
		sprintf_s(szTitle, MAX_PATH, "JArchiveEditor - %s",pFileName);
		m_pParent->SetWindowText(szTitle);
		strcpy_s(m_szArchiveName, MAX_PATH, pFileName);
	}

	RefreshFileList();
	ShowFileList(NULL);
	return true;
}
Example #3
0
LRESULT CFolderListCtrl::OnDirChange( WPARAM wParam, LPARAM lParam )
{
	RefreshFileList();
	return 0;
}