after clicking child window, cant interact with parent window
See the question and my original answer on StackOverflowThe problem is the button "steals the focus" when we click on it, so the window doesn't receive WM_KEYDOWN messages any more. This is by design. See also this on SO: C++ Window losing focus when child button is pressed
There are multiple way to fix it, but in this case the easier is to add a SetFocus call, right after the button has been clicked, like this:
case WM_COMMAND: {
switch (LOWORD(w_param)) {
case BN_CLICKED: {
board_controller_.reset_board();
SetFocus(m_hwnd_); // add this here to give focus back to window
break;
}
}
return 0;