title: WS_EX_LAYERED, invisible window, and a fresh install of Windows
body: <p>I would like to share with you this post as I wasted a lot of time to understand why the WS_EX_LAYERED flag did not work on a fresh install of Windows (my test was on a Win7, I don't know if it can be reproduced  on a Win8 o.s.).</p>
  
  <p>This was my code:</p>
  
  <pre><code>...
  
  hParentWindow=hWnd;
  HWND myWnd=CreateWindowEx(WS_EX_LAYERED|WS_EX_PALETTEWINDOW,_T("STATIC"),_T(""), WS_POPUP|SS_BITMAP,position.left,position.top, position.right, position.bottom,hWnd,NULL,hInst,NULL);
  </code></pre>
  
  <p>Then I wanted to add a transparent layer:</p>
  
  <pre><code>CWnd::FromHandle(myWnd)-&gt;SetLayeredWindowAttributes(RGB(0,0,0), 255*0.6, LWA_ALPHA);
  </code></pre>
  
  <p>Running the code, the window never appeared! And this was not a child window (the WS_EX_LAYERED does not work for a child window), so the WS_EX_LAYERED flag <strong>should</strong> have worked.</p>
  
  <p>Why?</p>