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

📄 page4.cpp

📁 C语言课程设计案例精编
💻 CPP
字号:
// Page4.cpp : implementation file
//

#include "stdafx.h"
#include "Page.h"
#include "Page4.h"

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

/////////////////////////////////////////////////////////////////////////////
// CPage4 property page

IMPLEMENT_DYNCREATE(CPage4, CPropertyPage)

CPage4::CPage4() : CPropertyPage(CPage4::IDD)
{
	//{{AFX_DATA_INIT(CPage4)
	m_str = _T("");
	//}}AFX_DATA_INIT
}

CPage4::~CPage4()
{
}

void CPage4::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CPage4)
	DDX_Control(pDX, IDC_EMAIL, m_email);
	DDX_Control(pDX, IDC_SHOCKWAVEFLASH1, m_flash);
	DDX_Text(pDX, IDC_EDIT1, m_str);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CPage4, CPropertyPage)
	//{{AFX_MSG_MAP(CPage4)
	ON_WM_LBUTTONDOWN()
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	ON_BN_CLICKED(IDC_EMAIL, OnEmail)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CPage4 message handlers

void CPage4::OnLButtonDown(UINT nFlags, CPoint point) 
{
	AfxGetMainWnd()->SendMessage(WM_NCLBUTTONDOWN,HTCAPTION,0);
	
	CPropertyPage::OnLButtonDown(nFlags, point);
}

BOOL CPage4::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
 
	m_email.SetToolTipText("写信给我:chx20@163.com");
    m_email.SetLinkCursor(AfxGetApp()->LoadCursor(IDC_HAND));

	char buf[200];
	::GetCurrentDirectory(200,buf);
	strcat(buf,"\\Clock.swf");	
	m_flash.SetMovie(buf);    //设置Flash的路径名
	m_flash.SetBGColor("D8E1FC");

	CStdioFile sf;
	if(sf.Open("Info.txt",CFile::modeRead))
	{
		CString  strTemp;
		while(sf.ReadString(strTemp))
		{
			m_str+=strTemp;
			m_str+="\r\n";
		}	
		UpdateData(false);
		
		sf.Close();
	}

	return TRUE;  
}

void CPage4::OnButton1() 
{
	ShellExecute(NULL,"open","许可协议.txt",NULL,NULL,SW_SHOWNORMAL);
}

void CPage4::OnEmail() 
{
	ShellExecute(NULL,"open","mailto:chx20@163.com",NULL,NULL,SW_SHOWNORMAL);


}

BOOL CPage4::PreTranslateMessage(MSG* pMsg) 
{
	if(pMsg->message==WM_RBUTTONDOWN && pMsg->hwnd==m_flash.m_hWnd)
		return true;

	if(pMsg->message==WM_LBUTTONDOWN && pMsg->hwnd==m_flash.m_hWnd)
	{
		AfxGetMainWnd()->SendMessage(WM_NCLBUTTONDOWN,HTCAPTION,0);
		return true;
	}

		
	return CPropertyPage::PreTranslateMessage(pMsg);
}


⌨️ 快捷键说明

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