Click here to Skip to main content
15,918,041 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCMFCPropertyGridCtrl column width Pin
eight30-Jul-09 1:32
eight30-Jul-09 1:32 
QuestionRead and Write to Microsoft Excel which support .xlsx format. Pin
Le@rner29-Jul-09 21:41
Le@rner29-Jul-09 21:41 
AnswerRe: Read and Write to Microsoft Excel which support .xlsx format. Pin
Adam Roderick J29-Jul-09 22:53
Adam Roderick J29-Jul-09 22:53 
GeneralRe: Read and Write to Microsoft Excel which support .xlsx format. Pin
Le@rner30-Jul-09 0:16
Le@rner30-Jul-09 0:16 
GeneralRe: Read and Write to Microsoft Excel which support .xlsx format. Pin
Adam Roderick J30-Jul-09 0:28
Adam Roderick J30-Jul-09 0:28 
AnswerRe: Read and Write to Microsoft Excel which support .xlsx format. Pin
Rajesh R Subramanian30-Jul-09 0:50
professionalRajesh R Subramanian30-Jul-09 0:50 
AnswerRe: Read and Write to Microsoft Excel which support .xlsx format. Pin
Dmytro Skrypnyk25-Aug-10 23:14
Dmytro Skrypnyk25-Aug-10 23:14 
QuestionUsing Opengl in Visual C++ Windows Form Application. Pin
emira6729-Jul-09 21:21
emira6729-Jul-09 21:21 
Questionreading & displaying bitmap image Pin
adichavan29-Jul-09 21:03
adichavan29-Jul-09 21:03 
AnswerRe: reading & displaying bitmap image Pin
CPallini29-Jul-09 22:45
mveCPallini29-Jul-09 22:45 
QuestionSet Database Password with MFC DAO Pin
sunny_vc29-Jul-09 20:10
sunny_vc29-Jul-09 20:10 
QuestionOutlook Folder Pin
john563229-Jul-09 20:00
john563229-Jul-09 20:00 
AnswerRe: Outlook Folder Pin
Adam Roderick J29-Jul-09 20:21
Adam Roderick J29-Jul-09 20:21 
QuestionRe: Outlook Folder Pin
john563229-Jul-09 20:41
john563229-Jul-09 20:41 
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 

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.