title: Can't handle WM_KEYDOWN message
body: <p>I'm trying to handle WM_KEYDOWN message using following wndproc and winmain but when I press a key(i.e. arrow keys which ascii value 24, 25, 26, 27) it doesn't handled.</p>
  <p><code>WndProc</code></p>
  <pre><code>LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam){
      /*TO CHECK uMsg message*/
      char buff[256];
      _itoa_s(uMsg, buff, 10);
      SetWindowText(hEdit, buff);
      /**********************/
      switch (uMsg)
          case WM_CREATE:
              hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, &quot;Edit&quot;, &quot;&quot;, WS_CHILD | WS_VISIBLE |ES_AUTOVSCROLL | ES_MULTILINE | ES_WANTRETURN | WS_VSCROLL, 735, 5, 150, 100, hWnd, NULL, hInst, NULL);
              HButton1 = CreateWindowEx(NULL, &quot;BUTTON&quot;, &quot;START&quot;, WS_CHILD | WS_VISIBLE | SS_CENTER, 2, 2, 80, 20, hWnd, (HMENU)IDC_BUTTON1, hInst, NULL);
              HButton2 = CreateWindowEx(NULL, &quot;BUTTON&quot;, &quot;B&quot;, WS_CHILD | WS_VISIBLE | SS_CENTER, 82, 2, 80, 20, hWnd, (HMENU)IDC_BUTTON2, hInst, NULL);
              HButton3 = CreateWindowEx(NULL, &quot;BUTTON&quot;, &quot;STOP&quot;, WS_CHILD | WS_VISIBLE | SS_CENTER, 162, 2, 80, 20, hWnd, (HMENU)IDC_BUTTON3, hInst, NULL);
              Hmainbmp = CreateWindowEx(NULL, &quot;STATIC&quot;, &quot;&quot;, WS_CHILD | WS_VISIBLE | SS_BITMAP | WS_THICKFRAME, 1, 23, 600, 500, hWnd, NULL, hInst, NULL);
              break;
          case WM_KEYDOWN:
              PRESSED_KEY = wParam;
              break;
          case WM_COMMAND:
                      break;
              case WM_DESTROY:
              PostQuitMessage(0);
              break;
          default:
              return(DefWindowProc(hWnd, uMsg, wParam, lParam));
      return(0L);
  }
  </code></pre>
  <p><code>WinMain</code></p>
  <pre><code>int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow){
      MSG      msg;
      WNDCLASSEX wc;
      HMENU MainMenu, FileMenu;
      MainMenu = CreateMenu();
      FileMenu = CreatePopupMenu();
      AppendMenu(FileMenu, MF_STRING, IDC_OPEN, &quot;Open&quot;);
      AppendMenu(MainMenu, MF_POPUP, (UINT_PTR)FileMenu, &quot;FILE&quot;);
  
      wc.style = CS_HREDRAW | CS_VREDRAW;
      wc.lpfnWndProc = (WNDPROC)WndProc;
      wc.cbClsExtra = 0;
      wc.cbWndExtra = 0;
      wc.hInstance = hInstance;
      wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));
      wc.hCursor = LoadCursor(NULL, IDC_ARROW);
      wc.hbrBackground = (HBRUSH)(COLOR_WINDOW);
      wc.lpszMenuName = lpszAppName;
      wc.lpszClassName = lpszAppName;
      wc.cbSize = sizeof(WNDCLASSEX);
      wc.hIconSm = (HICON)LoadImage(hInstance, lpszAppName, IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
  
      if (!RegisterClassEx(&amp;wc)) return(FALSE);
  
      hInst = hInstance;
      hWnd = CreateWindowEx(0, lpszAppName, lpszTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 900, 600, NULL, MainMenu, hInstance, NULL);
  
  
      if (!hWnd) return(FALSE);
  
      ShowWindow(hWnd, nCmdShow);
      UpdateWindow(hWnd);
      while (GetMessage(&amp;msg, NULL, 0, 0))
      {
          TranslateMessage(&amp;msg);
          DispatchMessage(&amp;msg);
      }
  
      return (int)msg.wParam;
  }
  </code></pre>
  <p>Why below case doesn't work? And how can I handle WM_KEYDOWN?</p>
  <pre><code>case WM_KEYDOWN:
      PRESSED_KEY = wParam;
      break;
  </code></pre>
  <p><strong>UPDATE</strong></p>
  <p>When I minimize and maximize window again, <code>WM_KEYDOWN</code> processed but if I click any button, it isn't working.</p>