fileproperty.cpp

来自「一个对系统执行文件提供方便管理的软件,里面用到的技术值得参考.」· C++ 代码 · 共 94 行

CPP
94
字号
// FileProperty.cpp : implementation file
//

#include "stdafx.h"
#include "PStart.h"
#include "FileProperty.h"
#include "PStartDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CFileProperty dialog
struct fp_info
{
	CString name;
	CString path;
};

CFileProperty::CFileProperty(CWnd* pParent /*=NULL*/)
	: CDialog(CFileProperty::IDD, pParent)
{
	//{{AFX_DATA_INIT(CFileProperty)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CFileProperty::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CFileProperty)
	DDX_Control(pDX, IDC_TAB, m_tab);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CFileProperty, CDialog)
	//{{AFX_MSG_MAP(CFileProperty)
	ON_BN_CLICKED(IDC_OK, OnOk)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFileProperty message handlers

BOOL CFileProperty::OnInitDialog()
{  
	CDialog::OnInitDialog();

	CRect rect;

	m_page4.m_Name=m_name;   
	m_page4.m_Path=m_path;

    m_tab.InsertItem(0, _T("General"));
	m_tab.InsertItem(1, _T("Advanced"));

    m_page4.Create(IDD_PAGE4, GetDlgItem(IDC_TAB));

    m_tab.GetClientRect(&rect);
	rect.top+=26;
	rect.left+=1;
	rect.bottom-=8;
	rect.right-=1;
	m_page4.MoveWindow(&rect);
    
	m_tab.SetCurSel(0);
    m_page4.ShowWindow(TRUE);       
    
	return TRUE;

}


void CFileProperty::OnOk() 
{
	// TODO: Add your control notification handler code here
	CPStartDlg *pmaindlg; 
    fp_info fp;

	fp.name=m_page4.m_Name;
	fp.path=m_page4.m_Path;
  
	pmaindlg=(CPStartDlg*)AfxGetApp()->m_pMainWnd;
	if(pmaindlg)
      pmaindlg->SendMessage(WM_FILEPROPERTY, 0, (LPARAM)&fp); 
    
	this->SendMessage(WM_CLOSE);
}

⌨️ 快捷键说明

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