So far i have gotten GetPixel() to do pretty much exactly what I want it to do inside of the client window. But, is there any way I can get the color of pixels outside the client window?

Heres my current code:

HDC     hDC;
     hDC = BeginPaint(hWnd, &ps);
     POINT pt;
     ScreenToClient(hWnd, &pt);
     COLORREF rgb = GetPixel(hDC, pt.x, pt.y);
     paint(hDC, rgb);
     EndPaint(hWnd, &ps);

hWnd is a global variable containing the HWND of the client window paint(hDC, rgb) is a function that draws a line across the window with the color rgb

GetWindowDesktop() only returns the HWND of the desktop.
I tried the following code, but it always returns black:

HWND desk = GetDesktopWindow(); 
     hDC = GetDC(desk);
     POINT pt;
     //ScreenToClient(hWnd, &pt);
     COLORREF rgb = GetPixel(hDC, pt.x, pt.y);

ok, nevermind, i got it.

I just used HWND_DESKTOP instead of GetDesktopWindow()