窗口类里注册快捷键
RegisterHotKey(GetSafeHwnd(),7788,MOD_CONTROL,VK_UP);//注册ctrl+向上方向键
添加快捷键响应函数
LRESULT CRunTreeView::OnHotKey(WPARAM wparam,LPARAM lparam)
{
MessageBox("CTRL+up");
return 0;
}
添加消息响应
ON_MESSAGE(WM_HOTKEY,OnHotKey)
注销快捷键
UnregisterHotKey(GetSafeHwnd(),7788);//ctrl+向上方向键