openfiledlg.cpp

来自「所有压缩格式的压缩解压缩。」· C++ 代码 · 共 63 行

CPP
63
字号
// OpenFileDlg.cpp : implementation file
//

#include "stdafx.h"
#include "Compress.h"
#include "OpenFileDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// COpenFileDlg

IMPLEMENT_DYNAMIC(COpenFileDlg, CFileDialog)

COpenFileDlg::COpenFileDlg(BOOL bOpenFileDialog, LPCTSTR lpszDefExt, LPCTSTR lpszFileName,
		DWORD dwFlags, LPCTSTR lpszFilter, CWnd* pParentWnd) :
		CFileDialog(bOpenFileDialog, lpszDefExt, lpszFileName, dwFlags, lpszFilter, pParentWnd)
{
	SetTemplate(NULL,"OpenFileDlg");
}

COpenFileDlg::COpenFileDlg(LPCTSTR lpszFilter, LPCTSTR lpszDefExt,
		LPCTSTR lpszFileName, DWORD dwFlags, CWnd* pParentWnd) :
		CFileDialog(TRUE, lpszDefExt, lpszFileName, dwFlags, lpszFilter, pParentWnd)
{
	SetTemplate(NULL,"OpenFileDlg");
}

BEGIN_MESSAGE_MAP(COpenFileDlg, CFileDialog)
	//{{AFX_MSG_MAP(COpenFileDlg)
	ON_WM_DESTROY()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


BOOL COpenFileDlg::OnInitDialog() 
{
	CFileDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_pComboBox=(CComboBox*)GetDlgItem(IDC_OPEN_AS);
	m_pComboBox->AddString("自动");

	int i,n=m_pLibNames->GetSize();
	for(i=0;i<n;i++) m_pComboBox->AddString(m_pLibNames->GetAt(i));

	m_pComboBox->SetCurSel(0);

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

void COpenFileDlg::OnDestroy() 
{
	m_LibIndex=m_pComboBox->GetCurSel()-1;
	
	CFileDialog::OnDestroy();
}

⌨️ 快捷键说明

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