Windows编程精选.ppt

OnKeyUp函数的代码如下: void CKeyboardDemoView::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) { // TODO: Add your message handler code here and/or call default if(nChar==VK_SHIFT)//判断Shift键是否被释放 { bShiftup=true; bShiftdown=false; Invalidate(true);//显示信息 } CView::OnKeyUp(nChar, nRepCnt, nFlags); } OnChar函数的代码如下: void CKeyboardDemoView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) { // TODO: Add your message handler code here and/or call default //判断是否同时敲击了字符键B键和Shift键 if((nChar==‘b’)||(nChar==‘B) //if((nChar==66)||(nChar==98)) { if(bShiftdown) { bShiftB

文档评论(0)

1亿VIP精品文档

相关文档