Hang on, you mean:

Check if the specific screen pixel is a certain colour, and if so, simulate a click event on it?

You need some API for this. What to do: WindowFromPoint will return the window handle. Then, offset the point into coordinates for that window. Then, get the colour using GetPixel. Compare that, and if so, simulate a click at that position, using SendMessage and WM_CLICK. If you need an example I'll post it here.