COLORREF as RGB or hexadecimal
<p>I have my current code that reads the getPixel from the current cursor position but the return value is just some insane value by COLORREF and I want it to be in RGB. I looked into Microsoft Reference and I found RGB Macro </p>

<pre><code>    COLORREF RGB(
   BYTE byRed,
   BYTE byGreen,
   BYTE byBlue
);
</code></pre>

<p>and my question is how should I use the return from GetPixel into this RGB function and then print the value?
Current code:</p>

<pre><code>include &lt;Windows.h&gt;
include &lt;wingdi.h&gt; 
include &lt;iostream&gt;
pragma comment(lib, "gdi32.lib")

  int main() {
    while (true) {

      HDC hDC;
      hDC = GetDC(NULL);
      POINT p;
      GetCursorPos( &amp; p);
      int cx = p.x;
      int cy = p.y;
      std::cout &lt;&lt; GetPixel(hDC,cx,cy) &lt;&lt; std::endl;
      Sleep(5);

    }

  }
</code></pre>