ツ未ヰ来ャ 发表于 2017-6-2 13:28:19

处理键盘输入

简单处理键盘输入
响应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, &amp;ps);
                // TODO: 在此添加任意绘图代码...
                ::TextOut(hdc, 0, 0, str.c_str(),str.length());
                EndPaint(hWnd, &amp;ps);
                break;
页: [1]
查看完整版本: 处理键盘输入