title: C++ Drawing directly to the screen (like an overlay)
body: <p>Many laptops nowadays have FN hot keys to change volume, brightness, etc. and usually display a visual cue that is rendered on the screen completely above the operating system. For new Windows 8/8.1 systems this visual even appears outside of the desktop in the metro side. They cannot be drawing inside of a borderless window otherwise it wouldn't show up over the metro interface.</p>
  
  <p>I have tried researching whether DirectX can draw directly to the screen but it doesn't appear it can. I don't even know if I should look into OpenGL... ?</p>
  
  <p>I had <em>some</em> success using GDI; specifically the GetDC function with the parameter NULL to grab the screen device.</p>
  
  <pre><code>#include &lt;Windows.h&gt;
  
  int main() {
      const HDC dc = GetDC(NULL);
      while (1) {
          Rectangle(dc, 100, 100, 500, 500);
      }
  }
  </code></pre>
  
  <p>However, this requires re-rendering everything repeatedly because my region of the screen can be overwritten by other windows changing in the background. And even with it re-rendering in a loop, there is massive screen flicker.</p>
  
  <p>How do the OEM manufacturers of these laptops achieve this?</p>
  
  <p>Thanks.</p>