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

📄 set.cpp

📁 wince 下的 小游戏
💻 CPP
字号:
// Set.cpp : 实现文件
//

#include "stdafx.h"
#include "test.h"
#include "Set.h"


// CSet 对话框

IMPLEMENT_DYNAMIC(CSet, CDialog)

CSet::CSet(CWnd* pParent /*=NULL*/)
	: CDialog(CSet::IDD, pParent)
	, m_nBGM(TRUE)
	, m_nSpeed(10)
{
	SetDlgItemInt(IDC_SPEED, 10);
	a=1;
}

CSet::~CSet()
{
}

void CSet::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Check(pDX, IDC_BGM, m_nBGM);
	DDX_Text(pDX, IDC_SPEED, m_nSpeed);
	DDV_MinMaxInt(pDX, m_nSpeed, 1,10);
}


BEGIN_MESSAGE_MAP(CSet, CDialog)
	ON_BN_CLICKED(IDC_BUTTON1, &CSet::OnBnClickedButton1)
	ON_EN_CHANGE(IDC_SPEED, &CSet::OnEnChangeSpeed)
END_MESSAGE_MAP()


// CSet 消息处理程序

void CSet::OnBnClickedButton1()
{
	// TODO: 在此添加控件通知处理程序代码
	m_nSpeed = GetDlgItemInt(IDC_SPEED);
	m_nBGM = IsDlgButtonChecked(IDC_BGM);
	a=m_nBGM;

	if(m_nBGM == 0){
		mciSendString(L"stop sound", NULL, 0, NULL);
		
	}
	else{
		mciSendString(L"play sound", NULL, 0, NULL);
	} 
	OnOK();
}

void CSet::OnEnChangeSpeed()
{
	// TODO:  If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function and call CRichEditCtrl().SetEventMask()
	// with the ENM_CHANGE flag ORed into the mask.

	// TODO:  Add your control notification handler code here
}

⌨️ 快捷键说明

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