摘要: 1. C和C++区别 C是结构化语言。C++是面向对象的语言。 2. C++中如何调用C编译器编译后的函数。 要在C++中添加extern “C”, 因为C++支持函数重载。编译后的函数的名字中包含参数的类型。C语言不支持函数重载。编译后,直接使用C++无法识别。 3. C++中的#ifndef #define #endif 的作用。 防止头文件被重复引用。 4. 宏定义问题 最小值... 阅读全文
posted @ 2013-02-18 23:59 GreenLight 阅读(181) 评论(0) 推荐(0)
摘要: (1)绘制点 利用GDI绘制点的时候不需要画笔和画刷。利用函数SetPixel。 The SetPixel function sets the pixel at the specified coordinates to the specified color. COLORREF SetPixel( _In_ HDC hdc, _In_ int X, _In_ int Y,... 阅读全文
posted @ 2013-02-17 17:37 GreenLight 阅读(227) 评论(0) 推荐(0)
摘要: 其中关于windows GDI的描述如下: Purpose The Microsoft Windows graphics device interface (GDI) enables applications to use graphics and formatted text on both the video display and the printer. Windows-based a... 阅读全文
posted @ 2013-02-17 14:23 GreenLight 阅读(2002) 评论(0) 推荐(0)
摘要: 赋值操作 1. 1 #include<iostream> 2 using namespace std; 3 4 int main() 5 { 6 int x = 2, y, z; 7 x*=( y = z = 5); cout << x << endl; // What is the x value ? 8 9 z =3;10 ... 阅读全文
posted @ 2013-02-12 23:59 GreenLight 阅读(222) 评论(0) 推荐(0)
摘要: 这里我们讨论两种消息传递的方法:SendMessage()和PostMessage(); (1)SendMessage Sends the specified message to a window or windows. The SendMessage function calls the window procedure for the specified window and does ... 阅读全文
posted @ 2013-02-12 23:35 GreenLight 阅读(1538) 评论(0) 推荐(0)
摘要: 我们这里仅讨论两个简单的消息: WM_MOUSEMOVE和WM_*BUTTON*。Parameters:wParam Indicates whether various virtual keys are down. This parameter can be one or more of the following values. ValueMeaning MK_CONTROL 0x0008The CTRL key is down.MK_LBUTTON 0x0001 The left mouse button is down.MK_MBUTTON 0x0010 The middle mouse 阅读全文
posted @ 2013-02-12 20:52 GreenLight 阅读(6336) 评论(0) 推荐(0)
摘要: 关于WM_KEYDOWN的消息中传递的是该键的虚拟扫描码,不是ASCII码。它传递了键被按下时的特征,细节的描述如下:wParamThe virtual-key code of the nonsystem key. See Virtual-Key Codes.lParamThe repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown following.例如,我们实现一个打印输入的virtual code的程序,只 阅读全文
posted @ 2013-02-12 18:36 GreenLight 阅读(475) 评论(0) 推荐(0)
摘要: 主要有下面三种方式访问键盘的消息:(1) WM_CHAR (2) WM_KEYDOWN 和WM_KEYUP (3) GetAsyncKeyState()。 当键盘上的"A”被按下的时候,会产生两种数据: (1) ASCII (2) Scan Code ,扫描码。其中,ASCII码会区分A和a两种不同的形式。 Scan code不会区别他们。首先,我们介绍WM_CHAR的消息。 可以查看MSDN... 阅读全文
posted @ 2013-02-12 17:01 GreenLight 阅读(3210) 评论(0) 推荐(0)
摘要: hWnd是窗口句柄,其中包含窗口的属性。例如,窗口的大小,显示位置,父窗口。hDC(Handle to Device Context)是图像的设备描述表,窗口显示上下文句柄,其中可以进行图形显示。利用hDC=GetDC(hWnd),可以获得一个窗口的图形设备描述表。可以通过ReleaseDC()函数释放。 下面的例子是获得图形设备表,并在窗口中打印text文本。 执行的结果,如下图。程序不停的执... 阅读全文
posted @ 2013-02-11 23:50 GreenLight 阅读(6466) 评论(0) 推荐(0)
摘要: 1. 计算机科学基础1.1 数值及其转换@ 2进制、10进制和16进制等常用数制及其相互的转换。 2进制与10进制之间的相互转换。(II) 2进制与16进制的相互转换。(I)[my review]计算机的数据单位1. bit (位)是计算机的最小的数据单位。 状态为0/1,为二进制。2. Byte (字节) 由8个bit构成,变换范围为0000 0000 ~ 1111 1111,共256种状态。转换成10进制表示为0~255。3. 1 Kilobyte (KB) = 1024byte, 1 Megabyte(MB) = 1024KB, 1 Gigabyte(GB) = 1024 MB, 1 T 阅读全文
posted @ 2012-07-03 22:58 GreenLight 阅读(321) 评论(0) 推荐(0)