title: How to display transparent png image files on a win32 button with color same as background color
body: <p>I have a win32 window with background color blue. I have created a button on the window using the code</p>
  
  <pre><code>// code for creating button
  
  hButton1= CreateWindow(_T("BUTTON"),_T("Test button"), BS_ICON  | WS_VISIBLE | WS_CHILD ,800,200,228,228,hWnd, (HMENU)1,NULL,NULL);
  </code></pre>
  
  <p>I loaded a .png transparent image as button image using the code</p>
  
  <pre><code>// code to     
  // using GDI
  GdiplusStartupInput gdiplusStartupInput;
  ULONG_PTR gdiplusToken;
  GdiplusStartup(&amp;gdiplusToken, &amp;gdiplusStartupInput, NULL);   
  
  Gdiplus::Bitmap* m_pBitmap;
  HICON hicon;
      m_pBitmap = Gdiplus::Bitmap::FromFile(L"d:\\gear.png");
      m_pBitmap-&gt;GetHICON(&amp;hicon);  
      LRESULT lr = SendMessage(hButton1,BM_SETIMAGE,IMAGE_ICON,(LPARAM)hicon );
  
  ShowWindow(hButton1,SW_SHOW);
  </code></pre>
  
  <p>Now the button is displayed with transparent .png image data with button default background color. I changed the button background color to blue. But when we load .png file , then button color changed to default color.</p>
  
  <p>I need to keep the transparent area of the button the same color as the background color of the window i.e. blue. You can refer the image of my window</p>
  
  <p><img src="https://i.stack.imgur.com/MtFVw.png" alt="This is the window displayed"></p>