
Visual C++学习笔记
文章平均质量分 73
wenzhoufeng
^_^
展开
-
什么是MFC
经常在VC 中听别人讲MFC但一直不知道到底是什么意思,MFC简单来说就是VC的类库.MFC是一个编程框架 MFC (Microsoft Foundation Class Library)中的各种类结合起来构成了一个应用程序框架,它的目的就是让程序员在此基础上来建立Windows下的应用程序,这是一种相对SDK来说更为简单的方法。因为总体上,MFC框架定义了应用程序的轮廓,并提供了用户接口的标准实原创 2007-11-12 11:04:00 · 74083 阅读 · 2 评论 -
WM_MOUSEMOVE 鼠标的坐标与是否按下检测
// DEMO3_13.CPP - WM_MOUSEMOVE demo// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#include // include all the windows headers#inclu原创 2007-11-23 16:20:00 · 6841 阅读 · 0 评论 -
随机画出随机颜色的点 SetPixel
// DEMO4_1.CPP - Pixel plotting demo// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#include // include all the windows headers#inc原创 2007-11-25 11:26:00 · 1729 阅读 · 0 评论 -
随机画出随机颜色的线hpen MoveToEx LineTo DeleteObject
// DEMO4_2.CPP - Line drawing demo// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#include // include all the windows headers#inclu原创 2007-11-25 11:41:00 · 2168 阅读 · 1 评论 -
画矩形 RECT FillRect
// DEMO4_3.CPP - Rectangle drawing demo// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#include // include all the windows headers#原创 2007-11-25 12:33:00 · 4825 阅读 · 0 评论 -
SetTimer 定时器
// DEMO4_6.CPP - WM_TIMER demo// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#include // include all the windows headers#include原创 2007-11-25 12:46:00 · 992 阅读 · 0 评论 -
创建常用按钮样式
// DEMO4_8.CPP - Child window Button Demo// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#include // include all the windows headers原创 2007-11-25 12:58:00 · 760 阅读 · 0 评论 -
一个游戏控制台的基本程序
// T3D Game Console, creates a game console application// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#include // include important原创 2007-11-25 13:02:00 · 976 阅读 · 0 评论 -
一个满天星星的演示
// DEMO4_9.CPP - Starfield demo based on T3D console// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#include // include important wi原创 2007-11-25 13:31:00 · 12157 阅读 · 0 评论 -
basic DirectDraw initialization demo 基本的directdraw初始化演示
// DEMO6_1.CPP basic DirectDraw initialization demo// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#define INITGUID // make sure dire原创 2007-11-25 22:34:00 · 925 阅读 · 0 评论 -
basic full-screen DirectDraw demo 基本全屏幕的directdraw演示
// DEMO6_1.CPP basic DirectDraw initialization demo// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#define INITGUID // make sure dire原创 2007-11-25 22:42:00 · 1270 阅读 · 0 评论 -
memset用法详解
memest原型 (please type "man memset" in your shell) void *memset(void *s, int c, size_t n); memset:作用是在一段内存块中填充某个给定的值,它对较大的结构体或数组进行清零操作的一种最快方法。常见的三种错误第一: 搞反了c 和 n的位置. 一定要记住 如果要把一个char a[20原创 2007-11-29 15:42:00 · 737 阅读 · 1 评论 -
#define的用法
#define的用法转自:http://www.dingge.com/main/article.asp?id=10今天整理了一些#define的用法,与大家共享!1.简单的define定义#define MAXTIME 1000 一个简单的MAXTIME就定义好了,它代表1000,如果在程序里面写if(i编译器在处理这个代码之前会对MAXTIME进行处理替换为1000。这样的定义看起来类似原创 2007-11-29 16:09:00 · 1053 阅读 · 0 评论 -
在VC中使用directdraw程序配置
#pragma comment(lib,"ddraw.lib") #pragma comment(lib,"dxguid.lib") 引上上面并且在VC编译器的选项中加上 directx安装目录include的目录路径,并且选择到最上面的优先原创 2007-11-29 14:45:00 · 1019 阅读 · 0 评论 -
关于菜单的补充,叠层菜单的定义
POPUP "Help" { MENUITEM "About", MENU_HELP_ABOUT POPUP "Test"{MENUITEM "Test1", MENU_HELP_ABOUT1MENUITEM "Test2", MENU_HELP_ABOUT2} }原创 2007-11-25 10:51:00 · 710 阅读 · 0 评论 -
KEYDOWN(VK_ESCAPE) 发送 SendMessage关闭窗口退出程序
// DEMO3_14.CPP - Message sending demo// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#include // include all the windows headers#in原创 2007-11-23 16:25:00 · 9395 阅读 · 0 评论 -
GetAsyncKeyState 功能的使用 判断上下左右键是否被按下或弹起
// DEMO3_12.CPP - GetAsynKeyState Demo// INCLUDES //////////GetAsyncKeyState/////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#include // include all the wi原创 2007-11-23 15:26:00 · 8159 阅读 · 0 评论 -
第一个对话框
// DEMO2_2.CPP - a simple message box#define WIN32_LEAN_AND_MEAN //这句的目的是指示编译器不要包含与MFC相关的操作。#include // the main windows headers #include // a lot of cool macros// main entry point原创 2007-11-21 13:56:00 · 533 阅读 · 0 评论 -
GetMessage()与peekMessage()的区别
如果消息队列里没有消息的时候不让Getmassage在Windows内部等待,就是说想充分利用程序的所有时间,就应该用peekmassage. peekmessage是一个类似于Getmessage的函数,区别在于当消息队列里有消息的时候,Peekmessage取回消息,并在eax中返回非零值,没有消息的时候它会直接返回,并在eax中返回零. 所以在返回非零值的时候,程序检查消息是否是WM_QU原创 2007-11-21 15:52:00 · 1751 阅读 · 0 评论 -
多窗体
// DEMO2_5.CPP - Creates two windows based on the same // window class// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#include // in原创 2007-11-21 16:11:00 · 547 阅读 · 0 评论 -
我的第一个窗体
// DEMO2_3.CPP - A complete windows program// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#include // include all the windows heade原创 2007-11-21 15:18:00 · 527 阅读 · 0 评论 -
第一个光标与第一个应用程序图标
// DEMO3_1.CPP - Demo of loading an icon and cursor resource// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#include // include all原创 2007-11-22 20:58:00 · 556 阅读 · 0 评论 -
播放我的第一个音乐
// DEMO3_2.CPP - Loading .WAV resources// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#include // include all the windows headers#i原创 2007-11-22 21:26:00 · 720 阅读 · 0 评论 -
我的第一个菜单
// DEMO3_4.CPP - Loading a MENU resource and processing selections// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#include // includ原创 2007-11-22 22:57:00 · 546 阅读 · 0 评论 -
利用HDC随机在工作区随机颜色产生文字
// DEMO3_5.CPP - text printing demo// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#include // include all the windows headers#inclu原创 2007-11-23 11:08:00 · 1522 阅读 · 0 评论 -
WM_PAINT 检测例子
// DEMO3_6.CPP - WM_PAINT tracker// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#include // include all the windows headers#include原创 2007-11-23 11:23:00 · 864 阅读 · 0 评论 -
阻止窗口关闭 WM_CLOSE,WM_DESTROY,WM_QUIT
// DEMO3_7.CPP - WM_CLOSE demo// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#include // include all the windows headers#include原创 2007-11-23 12:43:00 · 6464 阅读 · 0 评论 -
WM_SIZE 改变窗口大小 消息
// DEMO3_9.CPP - WM_SIZE demo// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#include // include all the windows headers#include /原创 2007-11-23 12:55:00 · 9618 阅读 · 0 评论 -
WM_MOVE 窗体移动后的位置
// DEMO3_10.CPP - WM_MOVE demo// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#include // include all the windows headers#include原创 2007-11-23 12:58:00 · 9295 阅读 · 0 评论 -
WM_CHAR 获取键盘按下的字符
// DEMO3_11.CPP - WM_CHAR demo// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN // just say no to MFC#include // include all the windows headers#include原创 2007-11-23 13:26:00 · 10574 阅读 · 3 评论 -
DIRECTINPUT输入函数库
// T3DLIB2.H - Header file for T3DLIB2.CPP game engine library// watch for multiple inclusions#ifndef T3DLIB2#define T3DLIB2// DEFINES ////////////////////////////////////////////////// MACROS /原创 2007-12-02 13:15:00 · 2174 阅读 · 0 评论