title: How to draw on given bitmap handle (C++ / Win32)?
body: <p>I'm writing an unmanaged Win32 C++ function that gets a handle to a bitmap, and I need to draw on it.</p>
  
  <p>My problem is that to draw I need to get a device context, but when I do GetDC (NULL), it gives me a device context for the WINDOW!  The parameter for GetDC () is a window handle (HWND), but I don't have a window; just a bitmap handle.</p>
  
  <p>How can I draw on this bitmap?  Thanks!</p>