title: How would I get the colour of a pixel within a program using the windows library in cpp?
body: <p>I know how to get the colour of a certain pixel on the screen via:</p>
  <pre><code>HDC dc = GetDC(NULL);
  COLORREF color = GetPixel(dc, x, y);
  </code></pre>
  <p>However, <code>GetDC</code> retrieves the whole screen if the parameter is NULL. How would I get it to retrieve the colour of a specific pixel for a program, say for Notepad instead of the whole screen?</p>
  <p>Please note I'm pretty new to C++ so it would be good if you explained it in layman's terms.</p>