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

📄 specfiledlg.cpp

📁 vc.net内幕系列源码
💻 CPP
字号:
// SpecFileDlg.cpp : implementation file
//

#include "stdafx.h"
#include "Ex07b.h"
#include "SpecFileDlg.h"


// CSpecialFileDialog dialog

IMPLEMENT_DYNAMIC(CSpecialFileDialog, CFileDialog)
CSpecialFileDialog::CSpecialFileDialog(BOOL bOpenFileDialog,
		LPCTSTR lpszDefExt, LPCTSTR lpszFileName, DWORD dwFlags,
		LPCTSTR lpszFilter, CWnd* pParentWnd)
	: CFileDialog(bOpenFileDialog, lpszDefExt, lpszFileName,
		dwFlags, lpszFilter, pParentWnd)
{
	m_ofn.Flags |= OFN_ENABLETEMPLATE;
	m_ofn.lpTemplateName = MAKEINTRESOURCE(IDD_FILESPECIAL);
	m_ofn.lpstrTitle = "Delete File";
	m_bDeleteAll = FALSE;
}

CSpecialFileDialog::~CSpecialFileDialog()
{
}

void CSpecialFileDialog::DoDataExchange(CDataExchange* pDX)
{
	CFileDialog::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CSpecialFileDialog, CFileDialog)
	ON_BN_CLICKED(IDC_DELETE, OnBnClickedDelete)
END_MESSAGE_MAP()


// CSpecialFileDialog message handlers

BOOL CSpecialFileDialog::OnInitDialog()
{
	BOOL bRet = CFileDialog::OnInitDialog();
	if (bRet == TRUE) {
		GetParent()->GetDlgItem(IDOK)->SetWindowText("Delete");
	}

    HICON hIcon = AfxGetApp()->LoadIcon(IDI_MYICON);
    GetParent()->SetIcon(hIcon, TRUE);        // Set big icon
    GetParent()->SetIcon(hIcon, FALSE);       // Set small icon

	return bRet;
}

void CSpecialFileDialog::OnBnClickedDelete()
{
	m_bDeleteAll = TRUE;
	// 0x480 is the child window ID of the File Name edit control
	//  (as determined by SPYXX)
	GetParent()->GetDlgItem(0x480)->GetWindowText(m_strFilename);
	GetParent()->SendMessage(WM_COMMAND, IDCANCEL);
}

⌨️ 快捷键说明

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