yes it's done elsewhere, i'm not the only one.
Obviously you aren't often capturing these crazy shaped windows, BUT if you use a windows xp or vista theme with rounded corners and such, then you probably noticed that screenshot captor used to give you a tiny bit of desktop background where the corners were which could be ugly. so this wil fix that
How'd you go around finding the window extents? GetObject + GetRegionData?
yep, it's get region data and then walking the image and masking it according to PtInRegion.