title: How to draw text without window
body: <p>I'm trying to display text on the screen, on top of everything, not clickable, without having any window. The idea is to be able to show notifications. I'm somewhat close from what I want, but a really weird problem just showed. This is the code:</p>
  
  <pre><code>#include &lt;Windows.h&gt;  
  
  int main(void){
  
      HDC hdc = ::GetDC(0);
      RECT rect;
      SetTextColor(hdc, RGB(0, 0, 255));
      SetBkMode(hdc, TRANSPARENT);
      SetBkColor(hdc, RGB(0, 0, 0));
      auto hFont = CreateFont(40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, L"Verdana");
      auto hTmp = (HFONT)SelectObject(hdc, hFont);
      rect.left = 40;
      rect.top = 10;
  
      while (true){
          DrawText(hdc, L"THIS IS A TEXT", -1, &amp;rect, DT_SINGLELINE | DT_NOCLIP);
          Sleep(1);
      }
      DeleteObject(SelectObject(hdc, hTmp));
      ::ReleaseDC(0, hdc);
      return 0;
  
  }
  </code></pre>
  
  <p>and this is what happens when I change the text settings from <code>red</code> to <code>blue</code> and size <code>80</code> to <code>40</code>:</p>
  
  <p><img src="https://i.stack.imgur.com/Kh4cC.png" alt="buggz"></p>
  
  <p>For some reason I can still see the old text, after rerunning the program, which tells me that I misunderstood something. Is there a better, cleaner way to do this?</p>
  
  <p>EDIT: I checked windows notifications and that's NOT a solution. Imagine you are playing a full screen game, and want to know if an email arrives. Another essential thing is that it cannot be clickable, so that clicks by mistake don't minimize your game. How annoying is that skype popup that minimizes your application when you get a call?</p>