Re: screenshot
CWnd * pDesktop = AfxGetDesktopWindow();
CDC *pDC = pDesktop->GetDC();
int Width = GetSystemMetrix(SM_CXFULLSCREEN);
int Height = GetSystemMetrics(SM_CXFULLSCREEN);
CDC MemDC;
MemDC.CreateCompatibleDC(pDC);
CBitmap Bitmap;
Bitmap.CreateCompatibleBitmap(pDC,Width,Height);
CBitmap *pOldBitmap = MemDC.SelectObject(&Bitmap);
MemDC.BitBlt(0,0,Width,Height,pDC,0,0,SRC_COPY);
MemDC.SelectObject(pOldBitmap);
pDesktop->ReleaseDC(pDC);
Now Bitmap has the picture of what's on the screen.
Here are two ways to save that bitmap to a file
http://www.codeproject.com/bitmap/drawing2bitmap.asp
http://www.codeproject.com/csharp/printcontrollerfile.asp
AliR
"Sam" <samkline@gmail.com> wrote in message
news:1148331133.616369.182460@j33g2000cwa.googlegroups.com...
hi,
i'm making a program in c++, using mfc. i need the program to take a
screenshot of the whole screen and save it as a file (jpg or png,
doesn't matter). can someone tell me how i can do this?
thanks in advance.