在MFC编程中  多文档下怎样在主窗口的空白处添加背景图片

解决方案 »

  1.   

    class CBMPClient : public CWnd
    {
    ......
    afx_msg BOOL OnEraseBkgnd(CDC* pDC);//  在此自绘制
    ......
    };class CMainFrame : public CMDIFrameWnd
    {
    .......
    protected:  // control bar embedded members
    CToolBar    m_wndToolBar;
    CBMPClient m_wndClient;
    ......
    };int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
    {
    if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
    return -1;

    if (!m_wndClient.SubclassWindow(m_hWndMDIClient))
    {
    TRACE("Failed to subclass MDI client window. \n");
    return -1;
    }......
    }
      

  2.   

    重写CMainFrame的OnEraseBkgrnd,然后贴图
      

  3.   

    你如果起的项目的名称是aaa,那就在aaaView中OnEraseBkgrnd添加背景图,添加背景图搜索就有答案了