title: Can you set a DDB on Static Picture Control
body: <p>I have the picture control created with SS_BITMAP style and bitmap created on a memory DC. so can or how can you set the <code>HBITMAP</code> of a DDB for the control? It doesn't work with using:</p>
  
  <p><strong>Edit:</strong></p>
  
  <pre><code>    HDC hDC = GetDC(hPB); //hPB, Handle to static control.
      HDC hMemDC = ::CreateCompatibleDC(hDC);
      HBITMAP hDDB = ::CreateCompatibleBitmap(hDC, 17, 14);
      SelectObject(hMemDC, hDDB);
  
      //Draw on DDB     
  
      SendMessage(hPB, STM_SETIMAGE, IMAGE_BITMAP, LPARAM(hDDB));
  
      DeleteObject(hDDB);
      DeleteObject(hBrush);
      ReleaseDC(hPB, hDC);
  </code></pre>