Usually people here will try to help others with their programming problems. If you want an answer to a question, that is a completely different thing. And even though you tried to avoid it, you finally told us what you wanted to achieve: Port some piece of Windows code with minimal changes.
The question that I asked is what anyone with some experience would ask: If anyone tries to read a pixel value from a window, then they are most likely trying hard to go into the completely wrong direction. And reading a pixel from a CGContextRef doesn't even make sense: What if that context is a PDF context and doesn't even have the concept of pixels?
i'd rather not divulge why i need this, simply because it IS the wrong approach. however, if the api were at my disposal, i'd rather save myself the time of doing it the right way.
having said that, i've already developed and implemented the work-around and it works fine.
if you want to know what i was trying to achieve, i have tabs created from device-independent bitmaps that are drawn to the screen individually. they should display a shadow, which is essentially a real-time filter applied over whatever the tab is positioned over, be it another tab, or just a blank space. since there was no access to the image buffer that drew the previous tab or other content, getpixel was used to 'see' what was visible in the windows device context. each pixel value retreived with getpixel was then passed through the filter with a shadow mask to generate the new pixel.
yes, this was not the best way to do it, but it worked. i appreciate you wanting to get to the root of my problem and guide me down the right path, but i'd have to argue that sometimes in programming, there's no such thing as 'right'. if you've been programming for any reasonable amount of time, you've probably cut corners to get something done and meet a deadline - and the last thing you want to do is get a technical lecture on how inefficient your code/approach is.
and also, i don't know how you can state with complete certainty that grabbing a pixel value from a window is the completely wrong direction. perhaps, i'm not as seasoned as you, but i've learned in my years that for every rule, there is an exception. why would other programming technologies have created that api in the first place, if it were completely wrong? now, i have work to do, so let's just leave that as a rhetorical question.
thanks everyone for your help, or good intentions!