Click here to Skip to main content
15,922,894 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Restricting others to inheritance from my class? Pin
David Crow10-Mar-08 6:07
David Crow10-Mar-08 6:07 
GeneralRe: Restricting others to inheritance from my class? Pin
Randor 10-Mar-08 6:16
professional Randor 10-Mar-08 6:16 
GeneralRe: Restricting others to inheritance from my class? Pin
Demian Panello10-Mar-08 6:21
Demian Panello10-Mar-08 6:21 
GeneralRe: Restricting others to inheritance from my class? Pin
Maxwell Chen10-Mar-08 6:25
Maxwell Chen10-Mar-08 6:25 
GeneralRe: Restricting others to inheritance from my class? Pin
led mike10-Mar-08 6:31
led mike10-Mar-08 6:31 
GeneralRe: Restricting others to inheritance from my class? Pin
Maxwell Chen10-Mar-08 6:48
Maxwell Chen10-Mar-08 6:48 
GeneralRe: Restricting others to inheritance from my class? Pin
led mike10-Mar-08 6:59
led mike10-Mar-08 6:59 
GeneralRe: Restricting others to inheritance from my class? Pin
Maxwell Chen10-Mar-08 7:03
Maxwell Chen10-Mar-08 7:03 
GeneralRe: Restricting others to inheritance from my class? Pin
led mike10-Mar-08 7:28
led mike10-Mar-08 7:28 
GeneralRe: Restricting others to inheritance from my class? Pin
Nemanja Trifunovic10-Mar-08 7:19
Nemanja Trifunovic10-Mar-08 7:19 
GeneralRe: Restricting others to inheritance from my class? [modified] Pin
led mike10-Mar-08 8:23
led mike10-Mar-08 8:23 
GeneralRe: Restricting others to inheritance from my class? Pin
ThatsAlok10-Mar-08 9:10
ThatsAlok10-Mar-08 9:10 
GeneralAccessing a method in the Dlg object from the App object. Pin
LCI10-Mar-08 5:17
LCI10-Mar-08 5:17 
GeneralRe: Accessing a method in the Dlg object from the App object. Pin
David Crow10-Mar-08 5:30
David Crow10-Mar-08 5:30 
GeneralRe: Accessing a method in the Dlg object from the App object. Pin
Maxwell Chen10-Mar-08 5:30
Maxwell Chen10-Mar-08 5:30 
GeneralRe: Accessing a method in the Dlg object from the App object. Pin
LCI10-Mar-08 5:37
LCI10-Mar-08 5:37 
GeneralRe: Accessing a method in the Dlg object from the App object. Pin
Maxwell Chen10-Mar-08 5:39
Maxwell Chen10-Mar-08 5:39 
GeneralRe: Accessing a method in the Dlg object from the App object. Pin
LCI10-Mar-08 5:47
LCI10-Mar-08 5:47 
GeneralRe: Accessing a method in the Dlg object from the App object. Pin
David Crow10-Mar-08 6:38
David Crow10-Mar-08 6:38 
GeneralRe: Accessing a method in the Dlg object from the App object. Pin
toxcct10-Mar-08 6:26
toxcct10-Mar-08 6:26 
GeneralRe: Accessing a method in the Dlg object from the App object. Pin
Nathan Holt at EMOM10-Mar-08 7:06
Nathan Holt at EMOM10-Mar-08 7:06 
GeneralPrintWindow Pin
Soumyadipta10-Mar-08 4:08
Soumyadipta10-Mar-08 4:08 
GeneralRe: PrintWindow Pin
Cranky10-Mar-08 4:29
Cranky10-Mar-08 4:29 
GeneralRe: PrintWindow Pin
Soumyadipta10-Mar-08 4:32
Soumyadipta10-Mar-08 4:32 
GeneralRe: PrintWindow Pin
Ernest Laurentin10-Mar-08 4:38
Ernest Laurentin10-Mar-08 4:38 
I assume you wanted to do this in MFC...
bool CaptureWindow(CWnd* pWnd, CBitmap* pBitmap)
{
    CRect rc;
    pWnd->GetClientRect( rc );
    CClientDC dc(pWnd);
    if ( pBitmap->CreateCompatibleBitmap(&dc, rc.Width(), rc.Height()))
    {
       CDC memdc;
       memdc.CreateCompatibleDC( &dc );
       CBitmap* pOldBitmap = (CBitmap*) memdc.SelectObject( pBitmap );
       memdc.BitBlt(0, 0, rc.Width(), rc.Height(), &dc, 0, 0, SRCCOPY);
       memdc.SelectObject( pOldBitmap );
       memdc.DeleteDC();
       return true;
    }
    return false;
}


God bless,
Ernest Laurentin

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.