I'm trying to capture screen of active windows by following the method as answerd by ArsenMkrt below
Please check ArsenMkrt's answer
Entire screen could be captured and it is perfect, but when I try to cpature active window, screen is clipped out on all edges for ex, for a few windows title bar is missing, for others, active window along with some other background is captured. I like the method mentioned in that answer. I believe some changes are to be made in the CopyFromScreen method to bring the required perfection. Could anyone guide me in doing those chanegs?