WM_KEYDOWN和WM_COMMAND

时间:2014-04-16 01:54:02

标签: c++ c winapi user-interface

当我按下窗口中的按钮时,我无法使用像VK_RETURN这样的按键来执行操作 ,我注意到按下它后按钮总是向下 ,有人知道如何解决它?

case WM_CREATE:{
CreateWindow(TEXT("BUTTON"),TEXT("button"),WS_VISIBLE|WS_CHILD,10,10,100,50,hwnd,(HMENU)ID_BT,NULL,NULL);
break;
}
case WM_KEYDOWN:{
        switch(wParam){
        case VK_RETURN:
        MessageBox(hwnd,"enter","keydown",MB_OK);
        break;
        }
        break;
    }
case WM_COMMAND:{
        switch(LOWORD(wParam)){
        case ID_BT: CreateWindow(TEXT("EDIT"),TEXT(""),WS_VISIBLE|WS_CHILD|WS_BORDER
            |ES_AUTOHSCROLL,10,cc,100,20,hwnd,(HMENU)ID_TBms,NULL,NULL);
        break;
        }
        break;
    }

0 个答案:

没有答案