How to get content of Window?

I work with AHK which works with gdip via dllcall function. I am interested how to do this in C++ because I would try to adopt the code to AHK as dll calls.

I have this window (the left one):
http://oi61.tinypic.com/302130y.jpg
And I need to receive handler of the ahk_class AOKTSMapView. I would like to get it to clipboard as a bitmap and rotate the map. Actually I don't need the black area, it could be trimmed.

For AHK, I have such start (this is not complete code, but the part which uses gdip) - this is a piece of code from ScreenCapture:
1
2
3
4
5
6
mDC := DllCall("CreateCompatibleDC", "Uint", 0)
hBM := CreateDIBSection(mDC, nW, nH)
oBM := DllCall("SelectObject", "Uint", mDC, "Uint", hBM)
hDC := DllCall("GetDC", "Uint", 0)
DllCall("BitBlt", "Uint", mDC, "int", 0, "int", 0, "int", nW, "int", nH, "Uint", hDC, "int", nL, "int", nT, "Uint", 0x40000000 | 0x00CC0020)
DllCall("ReleaseDC", "Uint", 0, "Uint", hDC)


So the AHK code knows the size of the rectangle. But I don't know the size of the rectangle so Want to ask you how to do it, to get the image, rotate it, crop it and finally to paste it to clipboard.

Last thing I need is to get location of the first pixel on screen and dimensions of the image.
Last edited on
Topic archived. No new replies allowed.