title: GDI+ GdipCreateBitmapFromHBITMAP in C++
body: <p>here is my function im trying to create bitmap from hbitmap here. But im getting identifier not found error.</p>
  
  <pre><code>    __declspec(dllexport) void __stdcall testFunction()
  {
      int W = 860, H = 720;
  
      int iLeft = 0, iRight = 860;
      int iTop = 0, iBottom = 720;
  
      int iW = iRight - iLeft, iH = iBottom - iTop;
  
      HWND bluestacks =  FindWindow(L"BlueStacksApp", L"BlueStacks App Player");
      HDC bHDC = GetWindowDC(bluestacks);
      HDC cHDC = CreateCompatibleDC(bHDC);
      HBITMAP bmp = CreateCompatibleBitmap( bHDC, W, H);
  
      HGDIOBJ sO =  SelectObject( cHDC, bmp);
      BOOL pW =PrintWindow( bluestacks, cHDC, 0);
      SelectObject(cHDC, bmp);
      BitBlt(cHDC, 0, 0, iW, iH, bHDC, iLeft, iTop, 0x00CC0020);
      Bitmap newBitmap = GdipCreateBitmapFromHBITMAP(bmp);
  
  }
  </code></pre>
  
  <p>Error code:</p>
  
  <p>identifier "GdipCreateBitmapFromHBITMAP" is undefined</p>
  
  <p>Note loaded header files:</p>
  
  <pre><code>    #include &lt;stdio.h&gt;
  #include &lt;windows.h&gt;
  #include &lt;iostream&gt;
  #include &lt;string.h&gt;
  #include &lt;strsafe.h&gt;
  #include &lt;gdiplus.h&gt;
  #include &lt;Gdiplusflat.h&gt; // Gdiplusflat.h
  #include &lt;ostream&gt;
  </code></pre>