简体   繁体   中英

Why doesn't my window get WM_SIZE command when handling WM_KEYDOWN myself?

I am unable to get WM_SIZE command if i use this method (or WM_KEYUP with same return 0 in end):

case WM_KEYDOWN: {
    keys[wParam] = 1;
    return 0;
}

But it gives me WM_SIZE command when i use this:

case WM_KEYDOWN: {
    keys[wParam] = 1;
    break;
}

Could someone explain why is this happening?

在没有看到整个代码的情况下,我的猜测是return语句阻止WM_KEYDOWN消息被传递给默认的消息处理程序,例如DefWindowProc() ,因此窗口实际上不会处理键击并采取它需要生成的任何操作WM_KEYUPWM_SIZE消息。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM