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

C / C++ / MFC

 
AnswerRe: Outlook Folder Pin
Adam Roderick J29-Jul-09 20:55
Adam Roderick J29-Jul-09 20:55 
GeneralRe: Outlook Folder Pin
john563229-Jul-09 21:12
john563229-Jul-09 21:12 
AnswerRe: Outlook Folder Pin
SandipG 29-Jul-09 22:40
SandipG 29-Jul-09 22:40 
GeneralRe: Outlook Folder Pin
john563230-Jul-09 0:00
john563230-Jul-09 0:00 
QuestionWin32API/MFC to capture desktop as an image Pin
Madhu_Rani29-Jul-09 19:38
Madhu_Rani29-Jul-09 19:38 
AnswerRe: Win32API/MFC to capture desktop as an image Pin
Adam Roderick J29-Jul-09 19:51
Adam Roderick J29-Jul-09 19:51 
GeneralRe: Win32API/MFC to capture desktop as an image Pin
«_Superman_»29-Jul-09 20:20
professional«_Superman_»29-Jul-09 20:20 
GeneralRe: Win32API/MFC to capture desktop as an image Pin
Adam Roderick J29-Jul-09 20:23
Adam Roderick J29-Jul-09 20:23 
offcourse superman's suggested method is better

see the code below for help Smile | :)

HDC hDesktopDC, hMemDC;
int nXPos = 0, nYPos = 0;
int nWidth = 0, nHeight = 0;
HGDIOBJ hOldBitmap, hBitmap;

// check for an empty rectangle
if ( IsRectEmpty( lpRect_i ))
{
return NULL;
}

// create a DC for the screen and create
// a memory DC compatible to screen DC
hDesktopDC = CreateDC( _T( "DISPLAY" ), NULL, NULL, NULL );
hMemDC = CreateCompatibleDC( hDesktopDC ); // get points of rectangle to grab
nXPos = lpRect_i->left;
nYPos = lpRect_i->top;
nWidth = lpRect_i->right - lpRect_i->left;
nHeight = lpRect_i->bottom - lpRect_i->top ;

// create a bitmap compatible with the screen DC
hBitmap = CreateCompatibleBitmap( hDesktopDC, nWidth, nHeight );
// select new bitmap into memory DC
hOldBitmap = SelectObject ( hMemDC, hBitmap );
// bitblt screen DC to memory DC
BitBlt( hMemDC, 0, 0, nWidth, nHeight, hDesktopDC, nXPos, nYPos, SRCCOPY );
// select old bitmap back into memory DC and get handle to
// bitmap of the screen
hBitmap = SelectObject( hMemDC, hOldBitmap );
// clean up
DeleteDC( hDesktopDC );
DeleteDC( hMemDC );
// return handle to the bitmap
return ( HBITMAP )hBitmap;

Величие не Бога может быть недооценена.

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 
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 

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.