• 大小: 9.96MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-11-09
  • 语言: C/C++
  • 标签: c++  详细代码  文档  

资源简介

使用c++开发的非常小巧别致的俄罗斯方块

资源截图

代码片段和文件信息

// tetris_0_0_1.cpp : Defines the entry point for the application.
//

#include “stdafx.h“
#include “tetris_0_0_1.h“
#include “sdk_game_controller.h“

#define MAX_LOADSTRING 100

// Global Variables:
HINSTANCE hInst; // current instance
TCHAR sztitle[MAX_LOADSTRING]; // The title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name

// Forward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE int);
LRESULT CALLBACK WndProc(HWND UINT WPARAM LPARAM);
INT_PTR CALLBACK About(HWND UINT WPARAM LPARAM);

// 窗口初始化宽度
#define WINDOW_INIT_WIDTH 550

// 窗口初始化高度
#define WINDOW_INIT_HEIGHT 600



int APIENTRY _tWinMain(_In_ HINSTANCE hInstance
                     _In_opt_ HINSTANCE hPrevInstance
                     _In_ LPTSTR    lpCmdLine
                     _In_ int       nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);

  // TODO: Place code here.
MSG msg;
HACCEL hAccelTable;

// Initialize global strings
LoadString(hInstance IDS_APP_title sztitle MAX_LOADSTRING);
LoadString(hInstance IDC_TETRIS_0_0_1 szWindowClass MAX_LOADSTRING);
MyRegisterClass(hInstance);

// Perform application initialization:
if (!InitInstance (hInstance nCmdShow))
{
return FALSE;
}

hAccelTable = LoadAccelerators(hInstance MAKEINTRESOURCE(IDC_TETRIS_0_0_1));

// Main message loop:
while (GetMessage(&msg NULL 0 0))
{
if (!TranslateAccelerator(msg.hwnd hAccelTable &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}

return (int) msg.wParam;
}



//
//  FUNCTION: MyRegisterClass()
//
//  PURPOSE: Registers the window class.
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;

wcex.cbSize = sizeof(WNDCLASSEX);

wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance MAKEINTRESOURCE(IDI_TETRIS_0_0_1));
wcex.hCursor = LoadCursor(NULL IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
//wcex.lpszMenuName = MAKEINTRESOURCE(IDC_TETRIS_0_0_1);
wcex.lpszMenuName = nullptr;
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance MAKEINTRESOURCE(IDI_SMALL));

return RegisterClassEx(&wcex);
}

//
//   FUNCTION: InitInstance(HINSTANCE int)
//
//   PURPOSE: Saves instance handle and creates main window
//
//   COMMENTS:
//
//        In this function we save the instance handle in a global variable and
//        create and display the main program window.
//
BOOL InitInstance(HINSTANCE hInstance int nCmdShow)
{
   HWND hWnd;

   hInst = hInstance; // Store instance handle in our global variable

   hWnd = CreateWindow(szWindowClass sztitle WS_OVERLAPPEDWINDOW
   CW_USEDEFAULT 0 WINDOW_INIT

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

     文件   52690944  2016-05-30 12:09  tetris\ipch\tetris_0_0_1-8284cfc4\tetris_0_0_1-c65e4b55.ipch

     文件      23040  2016-05-30 20:24  tetris\Release\tetris_0_0_1.exe

     文件        982  2016-05-22 19:33  tetris\tetris.sln

    ..A..H.     49152  2016-05-30 20:40  tetris\tetris.v12.suo

     文件       6860  2016-05-30 19:54  tetris\tetris_0_0_1\app.cpp

     文件       1271  2016-05-23 11:28  tetris\tetris_0_0_1\child_region.cpp

     文件       1652  2016-05-30 19:18  tetris\tetris_0_0_1\child_region.h

     文件     303847  2016-05-30 20:37  tetris\tetris_0_0_1\doc\俄罗斯方块.chm

     文件      27346  2016-05-11 07:38  tetris\tetris_0_0_1\doxygen\customdoxygen.css

     文件     303847  2016-05-30 20:37  tetris\tetris_0_0_1\doxygen\doc\html\index.chm

     文件      37793  2016-05-30 20:26  tetris\tetris_0_0_1\doxygen\doc\html\tetris_show01.PNG

     文件      18102  2016-05-30 20:27  tetris\tetris_0_0_1\doxygen\doc\html\tetris_show02.PNG

     文件      18957  2016-05-30 20:28  tetris\tetris_0_0_1\doxygen\doc\html\tetris_show03.PNG

     文件       1796  2016-05-30 20:39  tetris\tetris_0_0_1\doxygen\DoxygenFile.cfg

     文件        737  2016-05-11 07:45  tetris\tetris_0_0_1\doxygen\footer.html

     文件       1186  2016-05-17 06:48  tetris\tetris_0_0_1\doxygen\header.html

     文件        251  2016-05-30 20:33  tetris\tetris_0_0_1\doxygen\index.h

     文件       6089  2016-05-17 06:40  tetris\tetris_0_0_1\doxygen\layout.xml

     文件      15207  2016-05-11 08:11  tetris\tetris_0_0_1\doxygen\mydoxygen.png

     文件        788  2016-05-30 20:34  tetris\tetris_0_0_1\game_controller.h

     文件       3191  2016-05-30 19:54  tetris\tetris_0_0_1\game_panel.cpp

     文件       2216  2016-05-30 20:08  tetris\tetris_0_0_1\game_panel.h

     文件       4590  2016-05-30 19:55  tetris\tetris_0_0_1\left_game_region.cpp

     文件       2460  2016-05-30 19:54  tetris\tetris_0_0_1\left_game_region.h

     文件       2633  2016-05-22 19:33  tetris\tetris_0_0_1\ReadMe.txt

     文件        755  2016-05-22 19:33  tetris\tetris_0_0_1\Resource.h

     文件       2910  2016-05-30 17:53  tetris\tetris_0_0_1\right_info_region.cpp

     文件       1772  2016-05-30 19:28  tetris\tetris_0_0_1\right_info_region.h

     文件       1142  2016-05-30 19:54  tetris\tetris_0_0_1\sdk_game_controller.cpp

     文件        779  2016-05-30 20:36  tetris\tetris_0_0_1\sdk_game_controller.h

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

评论

共有 条评论