资源简介
在窗口中显示一个小球,该球以45度角反弹直线运动,碰撞后依然45度运行
代码片段和文件信息
// experiment3.cpp : Defines the entry point for the application.
//
#include “stdafx.h“
#include “resource.h“
#define MAX_LOADSTRING 100
// Global Variables:
HINSTANCE hInst; // current instance
TCHAR sztitle[MAX_LOADSTRING]; // The title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; // The title bar text
// Foward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE int);
LRESULT CALLBACK WndProc(HWND UINT WPARAM LPARAM);
LRESULT CALLBACK About(HWND UINT WPARAM LPARAM);
int xcenter = 300;
int ycenter = 300;
int xmove = 5;
int ymove = 5;
int APIENTRY WinMain(HINSTANCE hInstance
HINSTANCE hPrevInstance
LPSTR lpCmdLine
int nCmdShow)
{
// TODO: Place code here.
MSG msg;
HACCEL hAccelTable;
// Initialize global strings
LoadString(hInstance IDS_APP_title sztitle MAX_LOADSTRING);
LoadString(hInstance IDC_EXPERIMENT3 szWindowClass MAX_LOADSTRING);
MyRegisterClass(hInstance);
// Perform application initialization:
if (!InitInstance (hInstance nCmdShow))
{
return FALSE;
}
hAccelTable = LoadAccelerators(hInstance (LPCTSTR)IDC_EXPERIMENT3);
// Main message loop:
while (GetMessage(&msg NULL 0 0))
{
if (!TranslateAccelerator(msg.hwnd hAccelTable &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return msg.wParam;
}
//
// FUNCTION: MyRegisterClass()
//
// PURPOSE: Registers the window class.
//
// COMMENTS:
//
// This function and its usage is only necessary if you want this code
// to be compatible with Win32 systems prior to the ‘RegisterClassEx‘
// function that was added to Windows 95. It is important to call this function
// so that the application will get ‘well formed‘ small icons associated
// with it.
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = (WNDPROC)WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance (LPCTSTR)IDI_EXPERIMENT3);
wcex.hCursor = LoadCursor(NULL IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = (LPCSTR)IDC_EXPERIMENT3;
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance (LPCTSTR)IDI_SMALL);
return RegisterClassEx(&wcex);
}
//
// FUNCTION: InitInstance(HANDLE 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
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 159843 2012-03-28 09:13 experiment3\experiment3\Debug\experiment3.exe
文件 195224 2012-03-28 09:13 experiment3\experiment3\Debug\experiment3.ilk
文件 9295 2012-03-28 09:13 experiment3\experiment3\Debug\experiment3.obj
文件 1951796 2012-03-27 23:22 experiment3\experiment3\Debug\experiment3.pch
文件 459776 2012-03-28 09:13 experiment3\experiment3\Debug\experiment3.pdb
文件 2152 2012-03-27 23:22 experiment3\experiment3\Debug\experiment3.res
文件 55282 2012-03-27 23:22 experiment3\experiment3\Debug\StdAfx.obj
文件 91136 2012-03-28 09:13 experiment3\experiment3\Debug\vc60.idb
文件 176128 2012-03-28 09:13 experiment3\experiment3\Debug\vc60.pdb
文件 5748 2012-03-27 23:50 experiment3\experiment3\experiment3.cpp
文件 4556 2012-03-27 22:51 experiment3\experiment3\experiment3.dsp
文件 530 2012-03-27 22:51 experiment3\experiment3\experiment3.dsw
文件 341 2012-03-27 22:51 experiment3\experiment3\experiment3.h
文件 1078 2012-03-27 22:51 experiment3\experiment3\experiment3.ico
文件 53760 2012-03-28 09:14 experiment3\experiment3\experiment3.opt
文件 929 2012-03-28 09:13 experiment3\experiment3\experiment3.plg
文件 3109 2012-03-27 22:51 experiment3\experiment3\experiment3.rc
文件 2115 2012-03-27 22:51 experiment3\experiment3\ReadMe.txt
文件 801 2012-03-27 22:51 experiment3\experiment3\resource.h
文件 318 2012-03-27 22:51 experiment3\experiment3\small.ico
文件 298 2012-03-27 22:51 experiment3\experiment3\StdAfx.cpp
文件 936 2012-03-27 22:51 experiment3\experiment3\StdAfx.h
目录 0 2012-03-28 09:13 experiment3\experiment3\Debug
目录 0 2012-03-28 09:14 experiment3\experiment3
目录 0 2012-03-28 09:12 experiment3
文件 50176 2012-03-28 09:14 experiment3\experiment3\experiment3.ncb
----------- --------- ---------- ----- ----
3225327 26
相关资源
- 删除文件恢复C++实现
- SLICSuperpixels 超像素分割图 C++代码
- 理财管理系统 c++代码
- moravec算子c++代码
- FTP服务器C++代码实现
- utf8编码解码的纯C++代码
- PCA融合算法C++代码
- Jumping the Queue C++代码
- MOEA/D的C++代码
- DH密钥交换,C++代码
- Joseph C++代码
- SVM算法C++代码
- 基于MPI-GA的TSP问题C++代码
- 图像Susan角点检测算法代码非常稳健的
- 二叉树已知后序和中序遍历求前序遍
- 数据结构课程设计公交线路优化查询
- 阈值分割和区域生长vc++代码
- c++代码生成器
- UKF的C、C++代码实现
- 操作系统进程调度C++代码实现
- 操作系统请求分页存储器管理C++代码
- 卡尔曼滤波C++代码实现.zip
- C++代码提取LBP特征
- http上传C++代码实现
- 哈弗曼树的建立 C++代码
- aes加密算法的verilog和c++代码
- LEACH算法源代码_C++代码
- 数据结构中用栈实现迷宫问题的c++代
- 音频去噪C++代码,注释清晰可用
- 新安江模型C++代码 VS2008平台下
评论
共有 条评论