学习windows编程 day5 之按键消息

时间:2024-07-23 16:06:20
case WM_KEYDOWN://带sys的按键消息大多是系统需要自己处理的,我们一般不需要,默认处理
//wParam 指定按键的虚拟键代码
//lParam 指定技术,扫描码,闲钱状态,转换状态等 switch (wParam)
{
case VK_DOWN:
SendMessage(hwnd, WM_VSCROLL, SB_LINEDOWN, );
break;
case VK_UP:
SendMessage(hwnd, WM_VSCROLL, SB_LINEUP, );
break;
case VK_HOME://顶部
SendMessage(hwnd, WM_VSCROLL, SB_TOP, );
break;
case VK_END://尾部
SendMessage(hwnd, WM_VSCROLL, SB_BOTTOM, );
break;
case VK_PRIOR://上一页
SendMessage(hwnd, WM_VSCROLL, SB_PAGEUP, );
break;
case VK_NEXT://下一页
SendMessage(hwnd, WM_VSCROLL, SB_PAGEDOWN, );
break;
default:
break;
}
break;