Well, if it is your window and you want to use this function more often, my first approach would be to create a second window in the same application with the same exact measurements and xy coordinates only the z being lower (or is it higher
). This new form should of course not be transparent, and have some uniform color (gray for best results). Show this form only during screenshot event...and presto!
If it is not your window and application however, things can get a wee bit more tricky. You would have to find out all the necessary size and position data yourself and create the backdrop window according to the gathered information.
I guess
FindWindow and
GetWindowRect are a good starting point for that.
Sherlock