云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > VC++电脑游戏飞机大战的开发与设计(含源文件)

VC++电脑游戏飞机大战的开发与设计(含源文件)

  • 62 次阅读
  • 3 次下载
  • 2025/5/2 11:14:08

学位论文

BEGIN_MESSAGE_MAP(CMyDlg, CDialog) //{{AFX_MSG_MAP(CMyDlg) ON_WM_SYSCOMMAND() ON_WM_PAINT()

ON_WM_QUERYDRAGICON() ON_WM_DESTROY() ON_WM_TIMER() ON_WM_ERASEBKGND() ON_WM_KEYDOWN() //}}AFX_MSG_MAP ON_WM_LBUTTONDOWN() ON_WM_LBUTTONUP()

END_MESSAGE_MAP()

///////////////////////////////////////////////////////////////////////////// // CMyDlg message handlers

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

// Add \

// IDM_ABOUTBOX must be in the system command range. ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); ASSERT(IDM_ABOUTBOX < 0xF000);

CMenu* pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != NULL) { CString strAboutMenu;

strAboutMenu.LoadString(IDS_ABOUTBOX);

44

学位论文

if (!strAboutMenu.IsEmpty()) { pSysMenu->AppendMenu(MF_SEPARATOR); pSysMenu->AppendMenu(MF_STRING,

IDM_ABOUTBOX,

strAboutMenu);

}

}

// Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE);

// Set big icon

SetIcon(m_hIcon, FALSE);

// Set small icon

// TODO: Add extra initialization here this->SetWindowText(_T(\飞机大战\ InitData();

m_uTimer = SetTimer(1,30,NULL); srand((unsigned)time(NULL)); InitUserDC(); DrawContent();

return TRUE; // return TRUE unless you set the focus to a control

}

void CMyDlg::OnSysCommand(UINT nID, LPARAM lParam) { if ((nID & 0xFFF0) == IDM_ABOUTBOX) { CAboutDlg dlgAbout; dlgAbout.DoModal();

}

45

学位论文

}

else { }

CDialog::OnSysCommand(nID, lParam);

// If you add a minimize button to your dialog, you will need the code below // to draw the icon. For MFC applications using the document/view model, // this is automatically done for you by the framework.

void CMyDlg::OnPaint() {

/* if (IsIconic()) 0);

} else {

CDialog::OnPaint();

46

{

CPaintDC dc(this); // device context for painting

SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(),

// Center icon in client rectangle

int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect;

GetClientRect(&rect);

int x = (rect.Width() - cxIcon + 1) / 2; int y = (rect.Height() - cyIcon + 1) / 2; // Draw the icon

dc.DrawIcon(x, y, m_hIcon);

学位论文

}*/

CPaintDC dc(this); CRect rc; GetClientRect(rc);

dc.BitBlt(0,0,rc.Width(),rc.Height(),&m_dcMem,0,0,SRCCOPY);

}

// The system calls this to obtain the cursor to display while the user drags // the minimized window.

HCURSOR CMyDlg::OnQueryDragIcon() { return (HCURSOR) m_hIcon;

}

void CMyDlg::OnDestroy() { CDialog::OnDestroy();

// TODO: Add your message handler code here KillTimer(m_uTimer); DeleteUserDC(); delete[] pMEPOINT; delete[] pFLIVVERPOINT; delete[] pFLIVVER2POINT; delete[] pFLIVVER3POINT;

}

void CMyDlg::OnTimer(UINT nIDEvent) {

m_bgPlace = ++m_bgPlace % 601;

47

  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

学位论文 BEGIN_MESSAGE_MAP(CMyDlg, CDialog) //{{AFX_MSG_MAP(CMyDlg) ON_WM_SYSCOMMAND() ON_WM_PAINT() ON_WM_QUERYDRAGICON() ON_WM_DESTROY() ON_WM_TIMER() ON_WM_ERASEBKGND() ON_WM_KEYDOWN() //}}AFX_MSG_MAP ON_WM_LBUTTONDOWN() ON_WM_LBUTTONUP() END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CMyDl

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com