title: BitBlt a bitmap onto a splash screen
body: <p>I am working on a splash screen for a simple Direct3D game and although the screen itself is created and destroyed properly, the <code>BITMAP</code> meant to be projected onto the splash screen isn't showing up. I have this so far:</p>
  
  <pre><code>//variable declarations
  HWND splashWindow = NULL;
  BITMAP bm;
  
  //window procedure
  LRESULT WINAPI SplashProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
  {
      switch( msg )
      {
          case WM_DESTROY:
              PostQuitMessage(0);
              return 0;
          case WM_PAINT:
          {
              PAINTSTRUCT ps;
              HDC hdc = BeginPaint(splashWindow, &amp;ps);
              HDC hdcMem = CreateCompatibleDC(hdc);
              BitBlt(hdc, 0, 0, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0, SRCCOPY);
              DeleteDC(hdcMem);
              EndPaint(splashWindow, &amp;ps);
          }
      }
      return DefWindowProc( hWnd, msg, wParam, lParam );
  }
  
  int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
  {
      //initialize splash window settings
      WNDCLASSEX wc;
      wc.cbSize = sizeof(WNDCLASSEX); 
      wc.style         = CS_VREDRAW | CS_HREDRAW;
      wc.lpfnWndProc   = SplashProc;
      wc.cbClsExtra    = 0;
      wc.cbWndExtra    = 0;
      wc.hInstance     = hInstance;
      wc.hIcon         = NULL;
      wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
      wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
      wc.lpszMenuName  = NULL;
      wc.lpszClassName = "Splash Window";
      wc.hIconSm       = NULL;
      RegisterClassEx(&amp;wc);
  
      //create and draw the splash window
      HBITMAP splashBMP = (HBITMAP)LoadImage(hInstance, "assets\\textures\\splash.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
      GetObject(splashBMP, sizeof(bm), &amp;bm);
      //^-splashBMP to bm - used here so the window has proper dimensions
      splashWindow = CreateWindow("Splash Window", NULL,
          WS_POPUPWINDOW | WS_EX_TOPMOST, CW_USEDEFAULT, CW_USEDEFAULT,
          bm.bmWidth, bm.bmHeight, NULL, NULL, hInstance, NULL);
      if (splashWindow == 0) return 0;
  
      ShowWindow(splashWindow, nCmdShow);
      UpdateWindow(splashWindow);
      //after the game loads the splash screen is destroyed through DestroyWindow(splashWindow);
      //and splashBMP is released by calling DeleteObject(splashBMP);
  </code></pre>
  
  <p>Really, the only important code is <code>SplashProc</code> handling the <code>WM_PAINT</code> message.  The bitmap <code>bm</code> is loading fine shown through the window's 900x600 dimensions (same as splash.bmp).  However, that window is just a black screen instead of the herobrine face contained in splash.bmp xD</p>