i want make an mfc applicatio for screen capturing
-
Hello, I want to make a very small application capable of screen capturing. Plaese help me with some example. Thanks & Regards. Dhiraj
-
Hello, I want to make a very small application capable of screen capturing. Plaese help me with some example. Thanks & Regards. Dhiraj
You could try something like this, don't know if this actually works or not, didn't try it, but it can be a starting point for you, good luck:
CDC ScreenDC;
ScreenDC.Attach(::GetDC(NULL));CBitmap Capture;
CSize Dimensions(GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
Capture.CreateCompatibleBitmap(&ScreenDC, Dimensions.cx, Dimensions.cy);CDC MemDC;
MemDC.CreateCompatibleDC(&ScreenDC);CBitmap *OldBitmap = MemDC.SelectObject(&Capture);
MemDC.BitBlt(0, 0, Dimensions.cx, Dimensions.cy, &ScreenDC, 0, 0, SRCCOPY);
MemDC.SelectObject(OldBitmap);
MemDC.DeleteDC();::ReleaseDC(NULL, ScreenDC.Detach());
//At this point the bitmap 'Capture' should contain an image of the desktop> The problem with computers is that they do what you tell them to do and not what you want them to do. <