处理键盘输入
简单处理键盘输入响应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;
页:
[1]