- 注册时间
- 2011-3-6
- 最后登录
- 1970-1-1
该用户从未签到
|
简单处理键盘输入
响应WM_CHAR
#include <string>
static std::string str;
在wm_char中
str = str + char(wParam);
::InvalidateRect(hWnd, NULL, 0);
return 0;在wm_paint中
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
// TODO: 在此添加任意绘图代码...
::TextOut(hdc, 0, 0, str.c_str(),str.length());
EndPaint(hWnd, &ps);
break; |
|