Click here to Skip to main content
15,887,361 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Win32API/MFC to capture desktop as an image Pin
Madhu_Rani29-Jul-09 21:43
Madhu_Rani29-Jul-09 21:43 
GeneralRe: Win32API/MFC to capture desktop as an image Pin
Madhu_Rani29-Jul-09 23:17
Madhu_Rani29-Jul-09 23:17 
GeneralRe: Win32API/MFC to capture desktop as an image Pin
Adam Roderick J29-Jul-09 23:35
Adam Roderick J29-Jul-09 23:35 
GeneralRe: Win32API/MFC to capture desktop as an image Pin
Madhu_Rani29-Jul-09 23:41
Madhu_Rani29-Jul-09 23:41 
GeneralRe: Win32API/MFC to capture desktop as an image Pin
Adam Roderick J30-Jul-09 0:00
Adam Roderick J30-Jul-09 0:00 
GeneralRe: Win32API/MFC to capture desktop as an image Pin
Madhu_Rani30-Jul-09 0:05
Madhu_Rani30-Jul-09 0:05 
AnswerRe: Win32API/MFC to capture desktop as an image [modified] Pin
Adam Roderick J30-Jul-09 0:31
Adam Roderick J30-Jul-09 0:31 
GeneralRe: Win32API/MFC to capture desktop as an image Pin
Madhu_Rani30-Jul-09 1:59
Madhu_Rani30-Jul-09 1:59 
This is what I cooked, but it is not working... I know there is Invalidate() but it call onpaint again, so why we call it here.

void CSDITESTView::OnFileTest()
{

//m_pDC store the CDC pointer in OnDraw() function.

CDeskTop desktop;
CBitmap bitmap;
HWND hWnd=NULL;
bitmap.Attach(desktop.GetDeskTopImage());
BITMAP bm;
bitmap.GetBitmap(&bm );

CDC memDC;
CClientDC dc(this);
memDC.CreateCompatibleDC(&dc);
memDC.SelectObject(&bitmap );
m_pDC->BitBlt(0, 0, bm.bmWidth, bm.bmHeight, &memDC, 0, 0,SRCCOPY);
}

HBITMAP CDeskTop:: GetDeskTopImage()
{
int nScreenWidth = GetSystemMetrics(SM_CXSCREEN);
int nScreenHeight = GetSystemMetrics(SM_CYSCREEN);
HWND hDesktopWnd = GetDesktopWindow();
HDC hDesktopDC = GetDC(hDesktopWnd);
HDC hCaptureDC = CreateCompatibleDC(hDesktopDC);
HBITMAP hCaptureBitmap =CreateCompatibleBitmap(hDesktopDC,nScreenWidth, nScreenHeight);
SelectObject(hCaptureDC,hCaptureBitmap);
BitBlt(hCaptureDC,0,0,nScreenWidth,nScreenHeight, hDesktopDC,0,0,SRCCOPY|CAPTUREBLT);
ReleaseDC(hDesktopWnd,hDesktopDC);
DeleteDC(hCaptureDC);
return hCaptureBitmap;

}
GeneralRe: Win32API/MFC to capture desktop as an image Pin
Madhu_Rani30-Jul-09 2:05
Madhu_Rani30-Jul-09 2:05 
GeneralRe: Win32API/MFC to capture desktop as an image Pin
Asharudeed16-Feb-10 4:23
Asharudeed16-Feb-10 4:23 
QuestionemBDA.sys BSOD!!! [modified] Pin
Kiran Satish29-Jul-09 19:00
Kiran Satish29-Jul-09 19:00 
QuestionCRect Pin
kumar sanghvi29-Jul-09 18:45
kumar sanghvi29-Jul-09 18:45 
Questionhow to convert the matlab left matrix division \ into cv++ with opencv? Pin
DevelopmentNoob29-Jul-09 16:23
DevelopmentNoob29-Jul-09 16:23 
Question"Assertion Failed" with thread and device context Pin
nautilusvn29-Jul-09 16:11
nautilusvn29-Jul-09 16:11 
AnswerRe: "Assertion Failed" with thread and device context Pin
Richard Andrew x6429-Jul-09 16:51
professionalRichard Andrew x6429-Jul-09 16:51 
GeneralRe: "Assertion Failed" with thread and device context Pin
nautilusvn29-Jul-09 17:25
nautilusvn29-Jul-09 17:25 
GeneralRe: "Assertion Failed" with thread and device context Pin
Richard Andrew x6429-Jul-09 17:31
professionalRichard Andrew x6429-Jul-09 17:31 
GeneralRe: "Assertion Failed" with thread and device context Pin
Richard Andrew x6429-Jul-09 17:35
professionalRichard Andrew x6429-Jul-09 17:35 
GeneralRe: "Assertion Failed" with thread and device context Pin
nautilusvn29-Jul-09 20:27
nautilusvn29-Jul-09 20:27 
GeneralRe: "Assertion Failed" with thread and device context Pin
Richard Andrew x6430-Jul-09 4:14
professionalRichard Andrew x6430-Jul-09 4:14 
AnswerRe: "Assertion Failed" with thread and device context Pin
krmed30-Jul-09 6:53
krmed30-Jul-09 6:53 
QuestionPassing multi-dimensional array from C# to Win32 C++ dll? [modified] [MOVED TO C++/CLI] Pin
devvvy29-Jul-09 16:03
devvvy29-Jul-09 16:03 
AnswerRe: Passing multi-dimensional array from C# to Win32 C++ dll? Pin
Richard Andrew x6429-Jul-09 16:48
professionalRichard Andrew x6429-Jul-09 16:48 
Questionerror C1083 Pin
shabbychic29-Jul-09 15:57
shabbychic29-Jul-09 15:57 
AnswerRe: error C1083 Pin
Richard Andrew x6429-Jul-09 16:47
professionalRichard Andrew x6429-Jul-09 16:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.