资源简介

MFC实现的五子棋程序,可以人机对战,黑棋禁手等。。。。 MFC实现的五子棋程序,可以人机对战,黑棋禁手等。。。。 MFC实现的五子棋程序,可以人机对战,黑棋禁手等。。。。

资源截图

代码片段和文件信息

// MainFrm.cpp : implementation of the CMainframe class
//

#include “stdafx.h“
#include “wzq.h“

#include “MainFrm.h“

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

/////////////////////////////////////////////////////////////////////////////
// CMainframe

IMPLEMENT_DYNCREATE(CMainframe CframeWnd)

BEGIN_MESSAGE_MAP(CMainframe CframeWnd)
//{{AFX_MSG_MAP(CMainframe)
ON_WM_CREATE()
ON_COMMAND(ID_APP_EXIT OnAppExit)
ON_WM_CLOSE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

static UINT indicators[] =
{
ID_SEPARATOR           // status line indicator
ID_INDICATOR_CAPS
ID_INDICATOR_NUM
ID_INDICATOR_SCRL
};

/////////////////////////////////////////////////////////////////////////////
// CMainframe construction/destruction

CMainframe::CMainframe()
{
// TODO: add member initialization code here

}

CMainframe::~CMainframe()
{
}

int CMainframe::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CframeWnd::OnCreate(lpCreateStruct) == -1)
return -1;

if (!m_wndToolBar.CreateEx(this TBstyle_FLAT WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINframe))
{
TRACE0(“Failed to create toolbar\n“);
return -1;      // fail to create
}

if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators
  sizeof(indicators)/sizeof(UINT)))
{
TRACE0(“Failed to create status bar\n“);
return -1;      // fail to create
}

// TODO: Delete these three lines if you don‘t want the toolbar to
//  be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);

return 0;
}

BOOL CMainframe::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CframeWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
//  the CREATESTRUCT cs

cs.style = WS_OVERLAPPED | WS_CAPTION | FWS_ADDTOtitle
| WS_THICKframe | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_MAXIMIZE;
// cs.lpszName=_T(“五子棋“);

return TRUE;
}

/////////////////////////////////////////////////////////////////////////////
// CMainframe diagnostics

#ifdef _DEBUG
void CMainframe::AssertValid() const
{
CframeWnd::AssertValid();
}

void CMainframe::Dump(CDumpContext& dc) const
{
CframeWnd::Dump(dc);
}

#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CMainframe message handlers



void CMainframe::OnAppExit() 
{
// TODO: Add your command handler code here
if(MessageBox(“您真的要退出游戏吗?““注意“IDOK)==IDOK)
AfxGetMainWnd()->PostMessage(WM_QUIT);
else
return;
}



void CMainframe::OnClose() 
{
// TODO: Add your message handler code here and/or call default
OnAppExit();


}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       2921  2007-08-31 10:43  wzq editing\MainFrm.cpp

     文件       1504  2007-08-31 10:41  wzq editing\MainFrm.h

     文件       4239  2007-02-23 10:35  wzq editing\ReadMe.txt

     文件    1997718  2007-08-31 10:01  wzq editing\res\back.bmp

     文件       3678  2007-08-31 10:01  wzq editing\res\Black.bmp

     文件      47354  2007-08-29 19:51  wzq editing\res\blackwin.wav

     文件       1078  2007-08-18 17:55  wzq editing\res\Pente.ico

     文件       2120  2007-08-29 21:08  wzq editing\res\putstone.wav

     文件    1554534  2007-06-03 00:39  wzq editing\res\shu003.bmp

     文件        894  2007-08-21 12:33  wzq editing\res\small.ico

    ..A.SH.     27648  2007-08-31 11:03  wzq editing\res\Thumbs.db

     文件       3598  2007-08-31 11:08  wzq editing\res\Toolbar.bmp

     文件       3798  2007-08-30 19:38  wzq editing\res\undo.wav

     文件       3678  2007-08-31 10:01  wzq editing\res\white.bmp

     文件      44718  2007-08-29 20:13  wzq editing\res\whitewin.wav

     文件       1078  2007-02-23 10:35  wzq editing\res\wzq.ico

     文件        395  2007-02-23 10:35  wzq editing\res\wzq.rc2

     文件       1078  2007-02-23 10:35  wzq editing\res\wzqDoc.ico

     文件    3926830  2007-08-30 19:28  wzq editing\res\日本偶像剧钢琴曲-东京爱情故事.wav

     文件       1737  2007-08-31 11:08  wzq editing\Resource.h

     文件       1106  2007-08-20 22:34  wzq editing\selectColorDialog.cpp

     文件       1328  2007-08-18 01:58  wzq editing\selectColorDialog.h

     文件       1081  2007-08-29 19:46  wzq editing\selectGMDialog.cpp

     文件       1281  2007-08-29 19:45  wzq editing\selectGMDialog.h

     文件        205  2007-02-23 10:35  wzq editing\StdAfx.cpp

     文件       1054  2007-02-23 10:35  wzq editing\StdAfx.h

     文件        759  2007-06-02 16:31  wzq editing\Step.cpp

     文件       1234  2007-06-02 20:38  wzq editing\Step.h

     文件      25256  2007-08-31 10:31  wzq editing\Wzlz.cpp

     文件       1961  2007-08-29 19:52  wzq editing\Wzlz.h

............此处省略19个文件信息

评论

共有 条评论