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

📄 flashclockdlg.cpp

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

#include "stdafx.h"
#include "Page.h"
#include "FlashClockDlg.h"
#include <sys/stat.h>
#include <io.h>
#include <iostream.h>

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

/////////////////////////////////////////////////////////////////////////////
// CFlashClockDlg dialog


CFlashClockDlg::CFlashClockDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CFlashClockDlg::IDD, pParent)
{
}


void CFlashClockDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CFlashClockDlg)
	DDX_Control(pDX, IDC_SHOCKWAVEFLASH1, m_flash);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CFlashClockDlg, CDialog)
	//{{AFX_MSG_MAP(CFlashClockDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFlashClockDlg message handlers





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

//	int nH=::GetSystemMetrics(SM_CYCAPTION);  //标题栏高度
	CRect rc;
	GetClientRect(rc);
	CRgn rgn;
	rgn.CreateEllipticRgn(0,0,rc.Width(),rc.Height());
	this->SetWindowRgn(rgn, true);

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

	return true;
}

BOOL CFlashClockDlg::FileExist(const char *FileName) //判断文件是否存在  
{
    struct stat my_stat;
    return (stat(FileName, &my_stat) == 0);	
}

BEGIN_EVENTSINK_MAP(CFlashClockDlg, CDialog)
    //{{AFX_EVENTSINK_MAP(CFlashClockDlg)
	//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()



BOOL CFlashClockDlg::PreTranslateMessage(MSG* pMsg) 
{
	if(pMsg->message==WM_LBUTTONDOWN && pMsg->hwnd==m_flash.m_hWnd)
		SendMessage(WM_NCLBUTTONDOWN,HTCAPTION,0);

	if(pMsg->message==WM_RBUTTONDOWN && pMsg->hwnd==m_flash.m_hWnd)
		return true;

	if(pMsg->message==WM_LBUTTONDBLCLK && pMsg->hwnd==m_flash.m_hWnd)
		CDialog::OnOK();
	
	return CDialog::PreTranslateMessage(pMsg);
}

⌨️ 快捷键说明

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