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

📄 explain.txt.bak

📁 自己编写的一个简单的扫雷程序,主框架是基于对话框的
💻 BAK
字号:
//////////////////////////////////////////////////////////
/* read me */
This project is to implement a simple game named "Mine SWeeping"


The main class is CMineDlg,which is a subclass of CDialog.In another word,this game is 
based on a dialog flat roof(对话框平台).
The CMineDlg's primal partments are MainFrame(only contain Title Partment) and Client Area
at beginning.I append a File Bar to it(according to MainDialog's property).

composement:Title
            FileBar // the frontal two partments are controled by main dialog
            ControlBar // a CBitmapButton and two CLED objects
            Client Area // represented by Bitmaps


important items:
1>CLED is a new class which I set.It succeed from CWnd.In CLED's structure function,a create()
(CWnd::create())function is needed.In MSDN it is expressed as follow:
        /*
	You construct a child window in two steps. First, call the constructor, 
	which constructs the CWnd object. Then call Create, which creates the Windows 
	child window and attaches it to CWnd. Create initializes the window class name
	and window name and registers values for its style, parent, and ID.
	*/
Then we can use two corresponding functions: create() and delete();
2>How to get Randon number?
        srand((unsigned)time(0)); 
	int i=rand();
3>How to get and set a Timer?
In the Initial_function or begin_partment: SetTimer(XXX,XXX,NULL);
In the Class Guide,add a function depend on Message WM_TIMER.
In function OnTimer(),we can set some operations which need be finished every interval.
4>intercept a partment of a large bitmap and display it.
                CDC	* pDC=GetDC();
		CBitmap bitmap;
		CDC dc;
                bitmap.LoadBitmap(BITMAP ID);
		dc.CreateCompatibleDC(pDC);
		dc.SelectObject(&bitmap);
		pDC->BitBlt(m_width,m_height,16,16,&dc,X,Y,SRCCOPY); 
		                                // CPoint(X,Y) is intercept partment's left_up point


performing process:
1>Beginning
CMineApp theApp; --> struction of CMineDlg --> CMineDlg::CMineDlg CMineDlg::OnInitDialog() 
2>Initialization
OnInitDialog() --> InitVariables() InitWindow() InitControlBar()
File --> InitVariables() InitWindow() InitControlBar()
Main Control Button -->InitVariables() IniWindow() InitControlBar()
3>Message and Mapping
4>Close function


1>如何改变应用程序图标
2>如何改变应用程序窗口图像
  CMineDlg::CMineDlg()中
  m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); //可执行文件的“图标”

⌨️ 快捷键说明

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