I am trying to use API GetBkColor and GetSysColor(COLOR\_WINDOW) to get color of window but its giving me wrong value.
When I get color of wndow by using some tool its diffeent from what I get from API.

Any suggestion of how to get right value of color?

In case if window is using gradient color then how can I find the color at particular pixel?