Am having a window handle(hwnd). I want to take Screenshot of this window, I have used PrintWindow for this like this:
image.Create(imageWidth, imageHeight, 24);
HWND hwnd = ::FindWindow(0,"MyWindow");
PrintWindow(hwnd, imageDC, PW_CLIENTONLY);
With this code i get the specified window image in H:\\ drive. Now my question is : How do i take a screenshot of MyWindow with user specified area i.e., by specifying x-axis & y-axis. I mean, i don't want the entire image of MyWindow, I need only specified area of MyWindow i.e., Somewhere in the middle of MyWindow.
So How do i specify x & y coordinates to PrintWindow. Alternatively. i have tried with BitBlt & StretchBlt but they are relatively slower than PrintWindow.
Please someone can tell how to accomplish this.
Thank you all :)