title: Skinned Window: Win32 API and DirectX
body: <p>I'm trying to create a borderless window using a WS_EX_LAYERED style window. The objective is to render graphics using DirectX directly to the desktop, using alpha to blend onto the current desktop windows.</p>
  
  <p>Now on my system this technique seems to work perfectly. I can set various alpha levels and achieve different levels of transparency. Unfortunately several users have reported severe performance problems and low frame rate, making this technique unusable.</p>
  
  <p>The code setup is as follows:</p>
  
  <ol>
  <li>Create a layered (<strong>WS_EX_LAYERED</strong> extended-style) window.</li>
  <li>Initialize DirectX using the window HWND.</li>
  <li>Create a render target using the <strong>CreateRenderTarget</strong> DirectX method.</li>
  </ol>
  
  <p>Then during the render loop:</p>
  
  <ol>
  <li>Render graphics to the render target using DirectX calls.</li>
  <li>Get the HDC handle to the DirectX render target surface using <strong>GetDC</strong> method.</li>
  <li>Update the window contents using the <strong>UpdateLayeredWindow</strong> function, specifying the DirectX surface HDC.</li>
  </ol>
  
  <p>My question is: Am I doing something wrong? Is there a way to improve the performance of the window update. I have tried various things, like locking the render target and manually copying the bits to a DIB section to display in the window area, without success.</p>