Use FindWindow to obtain the desired window's HWND
Use GetDC to obtain that window's device context
Use GetPixel to obtain a color value inside that window
Done.
Or, if you need to capture the entire window to a bitmap...
Use FindWindow to obtain the desired window's HWND
Use GetDC to obtain that window's device context
Use CreateCompatibleDC to create a memory context to copy to
Use CreateCompatibleBitmap to create a bitmap that can hold the window picture
Use SelectObject to assign the bitmap to the memory context
Use BitBlt to do the actual copying
Use ReleaseDC to delete the memory context
Now, you have a bitmap with the contents of the window.