title: Getting the colour of a pixel at specified coordinate on the screen
body: <p>I need to get the colour of a pixel in the specified location. After some research this is what I have.</p>
  <pre><code>#include&lt;windows.h&gt;
  #include&lt;iostream&gt;
  
  int main()
  {
  
      HDC dc = GetDC(NULL);
      COLORREF color = GetPixel(dc, 100, 100);
      ReleaseDC(NULL, dc);
  
      std::cout &lt;&lt; GetRValue(color);
      std::cout &lt;&lt; GetGValue(color);
      std::cout &lt;&lt; GetBValue(color);
  
      return 0;
  }
  </code></pre>
  <p>I don't get any error but there are three weird characters displayed(which I cannot seem to copy and paste here). What can I do to get the pixel colour successfully?</p>