摘要: 赋值操作 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)