Click here to Skip to main content
16,016,087 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DB interfacing Pin
Joao Vaz24-May-02 20:14
Joao Vaz24-May-02 20:14 
GeneralRe: DB interfacing Pin
l a u r e n24-May-02 7:48
l a u r e n24-May-02 7:48 
GeneralRe: DB interfacing Pin
Matt Gullett24-May-02 9:50
Matt Gullett24-May-02 9:50 
Generalrnadial prototype Pin
24-May-02 4:51
suss24-May-02 4:51 
GeneralBitmap behind documents Pin
Dean Michaud24-May-02 4:10
Dean Michaud24-May-02 4:10 
GeneralRe: Bitmap behind documents Pin
Joaquín M López Muñoz24-May-02 4:26
Joaquín M López Muñoz24-May-02 4:26 
GeneralRe: Bitmap behind documents Pin
Dean Michaud24-May-02 4:48
Dean Michaud24-May-02 4:48 
GeneralRe: Bitmap behind documents Pin
Joaquín M López Muñoz24-May-02 5:07
Joaquín M López Muñoz24-May-02 5:07 
I guess the problem is you're not using DHTML, and the URL changes with this optio on.
Anyway, here's the post again.

--repost
It's simple task, but many steps are required:
  1. Create a new CWnd-derived class, say CBackgroundWnd.
  2. Add these two members to CBackgroundWnd:
    CBitmap m_bitmap_background;
    BITMAP m_bmInfo_background;
    along with this piece of code in CBackgroundWnd ctor:
    m_bitmap_background.LoadBitmap(IDB_BACKGROUND); // change IDB_BACKGROUND to whatever your resource-located bitmap is called.
    ::GetObject(m_bitmap_background,sizeof(BITMAP),&m_bmInfo_background);
    

  3. Add a handler for WM_ERASEBKGND in CBackgroundWnd and plug this code (which draws the bitmap in tesellation mode)
    BOOL CBackgroundWnd::OnEraseBkgnd(CDC* pDC) 
    {
        CRect rect;
        GetClientRect(rect);
    
        CDC dcMem;
        dcMem.CreateCompatibleDC(pDC);
        
        HBITMAP* pBmpOld=(HBITMAP*)::SelectObject(dcMem.m_hDC,m_bitmap_background);
    
        for(int y=rect.top;y<rect.bottom;y+=m_bmInfo_background.bmHeight){
            for(int x=rect.left;x<=rect.right;x+=m_bmInfo_background.bmWidth){
                pDC->BitBlt(x,y,m_bmInfo_background.bmWidth,m_bmInfo_background.bmHeight,
                            &dcMem,0,0,SRCCOPY);
            }
        }
    
        ::SelectObject(dcMem.m_hDC, pBmpOld);
    
        return TRUE;
    }

  4. Add a member of type CBackgroundWnd to your CMainFrame class, say m_wndClient.
  5. Override CMainFrame::OnCreateClient with this:
    BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) 
    {
    	if(!CMDIFrameWnd::OnCreateClient(lpcs, pContext))return FALSE;
    	m_wndClient.SubclassWindow(m_hWndMDIClient);
    	return TRUE;
    }
That's it, I think. Good luck.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
--end repost

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
GeneralRe: Bitmap behind documents Pin
Joao Vaz24-May-02 5:41
Joao Vaz24-May-02 5:41 
GeneralRe: Bitmap behind documents Pin
Joaquín M López Muñoz24-May-02 6:52
Joaquín M López Muñoz24-May-02 6:52 
GeneralRe: Bitmap behind documents Pin
Joao Vaz24-May-02 6:52
Joao Vaz24-May-02 6:52 
GeneralRe: Bitmap behind documents Pin
Dean Michaud24-May-02 7:08
Dean Michaud24-May-02 7:08 
QuestionHow can I get the path of the executed program in this program? Pin
24-May-02 3:24
suss24-May-02 3:24 
AnswerRe: How can I get the path of the executed program in this program? Pin
Joao Vaz24-May-02 3:38
Joao Vaz24-May-02 3:38 
GeneralRe: How can I get the path of the executed program in this program? Pin
Eugene Pustovoyt24-May-02 3:56
Eugene Pustovoyt24-May-02 3:56 
GeneralRe: How can I get the path of the executed program in this program? Pin
Nish Nishant24-May-02 4:35
sitebuilderNish Nishant24-May-02 4:35 
GeneralRe: How can I get the path of the executed program in this program? Pin
Chris Losinger24-May-02 4:47
professionalChris Losinger24-May-02 4:47 
GeneralRe: How can I get the path of the executed program in this program? Pin
Nish Nishant24-May-02 15:01
sitebuilderNish Nishant24-May-02 15:01 
GeneralRe: How can I get the path of the executed program in this program? Pin
Joao Vaz24-May-02 5:30
Joao Vaz24-May-02 5:30 
GeneralRe: How can I get the path of the executed program in this program? Pin
Nish Nishant24-May-02 15:14
sitebuilderNish Nishant24-May-02 15:14 
GeneralRe: How can I get the path of the executed program in this program? Pin
Joao Vaz24-May-02 20:15
Joao Vaz24-May-02 20:15 
GeneralRe: How can I get the path of the executed program in this program? Pin
27-May-02 10:49
suss27-May-02 10:49 
AnswerRe: How can I get the path of the executed program in this program? Pin
Alexandru Savescu24-May-02 12:43
Alexandru Savescu24-May-02 12:43 
GeneralWatch Window Formatting Pin
Mark Donkers24-May-02 3:16
Mark Donkers24-May-02 3:16 
GeneralRe: Watch Window Formatting Pin
Martin Ziacek24-May-02 4:16
Martin Ziacek24-May-02 4:16 

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.