title: SetPixelFormat return false when using pixel format gotten from wglChoosePixelFormatARB
body: <p>When I using SetPixelFormat to set pixel format for hDC, it returns false. I used GetLastError(), I get a error code 2000 (means invalid pixel format).</p>
  
  <p>The code as follow:</p>
  
  <pre><code>// Set pixel format attributes
  int pixelAttributes[] = {
      WGL_DRAW_TO_WINDOW_ARB, GL_TRUE,
      WGL_SUPPORT_OPENGL_ARB, GL_TRUE,
      WGL_DOUBLE_BUFFER_ARB, GL_TRUE,
      WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB,
      WGL_COLOR_BITS_ARB, bits,
      WGL_DEPTH_BITS_ARB, 24,
      WGL_STENCIL_BITS_ARB, 8,
      WGL_SAMPLE_BUFFERS_ARB, 1,      
      WGL_SAMPLES_ARB, 4,             
      0
  };
  
  int pixelFormat;
  UINT numFormat;
  
  // using wgl ext get valid pixel format number.
  if (!wglChoosePixelFormatARB(hDC, pixelAttributes, NULL, 1, &amp;pixelFormat, &amp;numFormat)) {
      KillGLWindow();     
      MessageBox(NULL, L"Get pixel format failed", L"Error", MB_OK | MB_ICONEXCLAMATION);
      return FALSE;
  }
  
  if (!SetPixelFormat(hDC, pixelFormat, &amp;pfd))        // try to set pixel format
  {
      auto x = GetLastError();
      KillGLWindow();                             // close
  
      MessageBox(NULL, L"Unable to set pixel format.", L"Error", MB_OK | MB_ICONEXCLAMATION);
      return FALSE;
  }
  </code></pre>
  
  <p>These code is after create and active a FALSE openGL context<a href="https://www.opengl.org/wiki/Creating_an_OpenGL_Context_(WGL)" rel="nofollow">Create WGL</a>.</p>