// shuDlg.cpp : implementation file
//
#include "stdafx.h"
#include "shu.h"
#include "shuDlg.h"
#include "MMSYSTEM.H"
#pragma comment(lib, "winmm.lib")
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
MCI_PLAY_PARMS mciplay1;
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CShuDlg dialog
CShuDlg::CShuDlg(CWnd* pParent /*=NULL*/)
: CDialog(CShuDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CShuDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_hIcon = AfxGetApp()->LoadIcon(IDI_ICON8);
hcur=AfxGetApp()->LoadCursor(IDC_CURSOR1);
}
void CShuDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CShuDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CShuDlg, CDialog)
//{{AFX_MSG_MAP(CShuDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_COMMAND(ID_FILE_NEW, OnFileNew)
ON_WM_TIMER()
ON_WM_SETCURSOR()
ON_BN_CLICKED(IDC_BUTTON3, Onkai)
ON_BN_CLICKED(IDC_BUTTON4, Onload)
ON_BN_CLICKED(IDC_BUTTON5, Onquit)
ON_BN_CLICKED(IDC_BUTTON6, Onsave)
ON_BN_CLICKED(IDC_BUTTON7, Onnew)
ON_BN_CLICKED(IDC_BUTTON8, OnBu8)
ON_BN_CLICKED(IDC_BUTTON9, Onbai)
ON_BN_CLICKED(IDC_BUTTON10, Onbusav)
ON_LBN_DBLCLK(IDC_BUTTON11,Onloadd)
ON_CBN_EDITCHANGE(IDC_BUTTON11,Onelse)
ON_BN_CLICKED(IDC_BUTTON20, Ongao)
ON_BN_CLICKED(IDC_BUTTON22, Onwan)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CShuDlg message handlers
BOOL CShuDlg::OnInitDialog()
{ //skinppLoadSkin(_T("skin\\xp_corona.ssk"));
MCI_OPEN_PARMS mciopen;
MCI_OPEN_PARMS mciopen1;
mciopen1.lpstrElementName="back2.mid";
mciopen1.lpstrDeviceType="sequencer";
mciSendCommand(NULL, MCI_OPEN,
MCI_OPEN_TYPE | MCI_OPEN_ELEMENT,
(DWORD)(LPVOID) &mciopen1);
wdid1=mciopen1.wDeviceID;
mciopen.lpstrDeviceType="sequencer";
mciopen.lpstrElementName="back1.mid";
mciSendCommand(NULL, MCI_OPEN,
MCI_OPEN_TYPE | MCI_OPEN_ELEMENT,
(DWORD)(LPVOID) &mciopen);
wdid=mciopen.wDeviceID;
bit=LoadBitmap(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDB_BITMAP1));
hdc=CreateCompatibleDC(NULL);
RECT rec,rec1,edi;
RECT rec5;
rec5.bottom=100;rec5.top=60;rec5.left=140;rec5.right=290;
gamebl.Create(" ",BS_BITMAP
,rec5,this,IDC_BUTTON7);
rec5.bottom=300;rec5.top=130;rec5.left=140;rec5.right=290;
mylis.Create(LBS_NOTIFY|WS_VSCROLL,rec5,this,IDC_BUTTON11);
rec5.bottom=125;rec5.top=100;rec5.left=150;rec5.right=250;
listt.Create(" ",BS_BITMAP
,rec5,this,IDC_BUTTON22);
listt.loadbitmap(IDB_BITMAP35,IDB_BITMAP34,IDB_BITMAP33);
gamebl.loadbitmap(IDB_BITMAP17,IDB_BITMAP18,IDB_BITMAP19);
rec5.bottom=150;rec5.top=110;rec5.left=140;rec5.right=290;
gamebu.Create(" ",BS_BITMAP
,rec5,this,IDC_BUTTON3);
gamebp.Create(" ",BS_BITMAP
,rec5,this,IDC_BUTTON6);
gamebp.loadbitmap(IDB_BITMAP14,IDB_BITMAP15,IDB_BITMAP16);
gamebu.loadbitmap(IDB_BITMAP2,IDB_BITMAP3,IDB_BITMAP4);
gamebu.ShowWindow(5);
rec5.bottom=200;rec5.top=160;rec5.left=140;rec5.right=290;
gamebi.Create(" ",BS_BITMAP
,rec5,this,IDC_BUTTON4);
gamebi.loadbitmap(IDB_BITMAP6,IDB_BITMAP5,IDB_BITMAP8);
gamebi.ShowWindow(5);
rec5.bottom=190;rec5.top=150;rec5.left=80;rec5.right=330;
gamebs.Create(" ",BS_BITMAP
,rec5,this,IDC_BUTTON10);
gamebs.loadbitmap(IDB_BITMAP28,IDB_BITMAP29,IDB_BITMAP26);
rec5.bottom=250;rec5.top=210;rec5.left=140;rec5.right=290;
gamebo.Create(" ",BS_BITMAP
,rec5,this,IDC_BUTTON5);
gamebo.loadbitmap(IDB_BITMAP10,IDB_BITMAP11,IDB_BITMAP12);
gamebo.ShowWindow(5);
rec5.bottom=300;rec5.top=260;rec5.left=140;rec5.right=290;
gamebj.Create(" ",BS_BITMAP
,rec5,this,IDC_BUTTON9);
gamebj.loadbitmap(IDB_BITMAP23,IDB_BITMAP24,IDB_BITMAP25);
gamebj.ShowWindow(5);
rec5.bottom=300;rec5.top=260;rec5.left=140;rec5.right=290;
gamebk.Create(" ",BS_BITMAP
,rec5,this,IDC_BUTTON8);
gamebk.loadbitmap(IDB_BITMAP20,IDB_BITMAP21,IDB_BITMAP22);
edi.top=13;edi.bottom=320;edi.left=97;edi.right=253;
edit.Create(" ",SS_CENTER|WS_VISIBLE,edi,this,0xffff);
edit.ShowWindow(0);
edi.top=63;edi.bottom=117;edi.left=321;edi.right=399;
edit1.Create(" 0 ",SS_CENTER|WS_VISIBLE|SS_CENTERIMAGE,edi,this,ID_STR);
edit1.ShowWindow(0);
edi.top=53;edi.bottom=77;edi.left=321;edi.right=399;
edit2.Create("第 1 关",SS_CENTER|WS_VISIBLE|SS_CENTERIMAGE,edi,this,0xffff);
edit2.ShowWindow(0);
edi.top=107;edi.bottom=137;edi.left=321;edi.right=399;
edit3.Create("第 0 行",SS_CENTER|WS_VISIBLE|SS_CENTERIMAGE,edi,this,0xffff);
edit3.ShowWindow(0);
rec.top=1;rec.left=100;rec.right=115;rec.bottom=16;
for (int e=4;e<24;e++)
{rec.top=rec.top+15;rec.bottom=rec.bottom+15;rec.left=100;rec.right=115;
for (int i=0;i<10;i++)
{ els[e][i]=0;
els2[e][i]=0;
cstr[e][i].Create(" ",WS_BORDER|SS_CENTERIMAGE|
SS_ICON|WS_CHILD|WS_VISIBLE,rec,this,0xffff);
rec.left=rec.left+15;rec.right=rec.right+15;
cstr[e][i].ShowWindow(els[e][i]);
}
}
rec1.top=150;rec1.left=260;rec1.right=260;rec1.bottom=165;
for (int o=0;o<4;o++)
{
for (int u=0;u<10;u++)
{
cstr[o][u].Create(" ",SS_BLACKFRAME|WS_BORDER,rec1,this,0xffff);
cstr[o][u].ShowWindow(0);
}
}
rec1.top=150;rec1.left=260;rec1.right=275;rec1.bottom=165;
for (int k=0;k<4;k++)
{rec1.top=rec1.top+15;rec1.bottom=rec1.bottom+15;rec1.left=290;rec1.right=305;
for (int l=0;l<4;l++)
{
els1[k][l]=0;
rec1.left=rec1.left+15;rec1.right=rec1.right+15;
cstr1[k][l].Create(" ",WS_BORDER|SS_CENTERIMAGE|
SS_ICON|WS_CHILD|WS_VISIBLE,rec1,this,0xffff);
cstr1[k][l].ShowWindow(els1[k][l]);
}
}
RECT recte;
recte.top=105;recte.bottom=145;recte.left=140;recte.right=290;
gamegao.Create(" ",BS_BITMAP
,recte,this,IDC_BUTTON20);
gamegao.loadbitmap(IDB_BITMAP31,IDB_BITMAP32,IDB_BITMAP30);
recte.top=160;recte.bottom=180;recte.left=140;recte.right=290;
for (int qq=0;qq<10;qq++)
{bai[qq].Create(" 0 ",WS_BORDER,recte,this,0xffff);
recte.top=recte.top+20;recte.bottom=recte.bottom+20;
bai[qq].mb1=RGB(64,24,128);
}
a1=3;b1=4;c1=5;d1=6;a=0;b=0;c=0;d=0;dd=0;wqr=false;jiang0=0;
e1=0;f1=1;g1=2;h1=3;z=2;f=2;g=2;h=2;ab=0;cd=0;fenshu=0;guan=1;
tim=1000;guan1=0;hhh=0;playmid="back2.mid";wqr1=false;
abcd=0;xian=true;bk=10;xuan=15;xuan1=400;xuan2=1;xuan3=100;
jiang1=0;color=bk;esc=true;sav1=false;sav2=true;over=false;
over1=false;
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// 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);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pS