Solved

Background Bitmap in CMDIFrameWnd

Posted on 1998-03-15
2
255 Views
Last Modified: 2013-11-20
How do I display a bitmap, or pattern in the frame window of an MDI application? I would like to display a logo etc when no Child windows are open.
0
Comment
Question by:cjs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
scroll0 earned 50 total points
ID: 1316996
        //MainFrm.h
            CBitmapClient m_wndClient;
         //MainFrm.cpp
         //OnCreate(LPCREATESTRUCT lpCreateStruct)
      if(!m_wndClient.SubclassWindow(m_hWndMDIClient))
      {
            TRACE("Failed Load BitMap");
            return -1;
      }


//CBitmapClient Haeder File
// BitmapClient.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CBitmapClient window
class CBitmapClient : public CWnd
{
// Construction
public:
      CBitmapClient();

// Attributes
public:

// Operations
public:

// Overrides
      // ClassWizard generated virtual function overrides
      //{{AFX_VIRTUAL(CBitmapClient)
      //}}AFX_VIRTUAL

// Implementation
public:
      virtual ~CBitmapClient();

      // Generated message map functions
protected:
      //{{AFX_MSG(CBitmapClient)
      afx_msg void OnSize(UINT nType, int cx, int cy);
      afx_msg BOOL OnEraseBkgnd(CDC* pDC);
      afx_msg void OnMouseMove(UINT nFlags, CPoint point);
      afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
      //}}AFX_MSG
      DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

// BitmapClient.cpp : implementation file
//

#include "stdafx.h"
#include "ViewG.h"
#include "BitmapClient.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CBitmapClient

CBitmapClient::CBitmapClient()
{
}

CBitmapClient::~CBitmapClient()
{
}


BEGIN_MESSAGE_MAP(CBitmapClient, CWnd)
      //{{AFX_MSG_MAP(CBitmapClient)
      ON_WM_SIZE()
      ON_WM_ERASEBKGND()
      ON_WM_MOUSEMOVE()
      ON_WM_LBUTTONUP()
      //}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CBitmapClient message handlers

void CBitmapClient::OnSize(UINT nType, int cx, int cy)
{
      CWnd::OnSize(nType, cx, cy);
             
      RedrawWindow(NULL, NULL,
             RDW_INVALIDATE|RDW_ERASE|RDW_ERASENOW|RDW_ALLCHILDREN);    
      return ;  
}

BOOL CBitmapClient::OnEraseBkgnd(CDC* pDC)
{
      CWnd::OnEraseBkgnd(pDC);
         //Here BitMap File Load
   return TRUE;
}


void CBitmapClient::OnMouseMove(UINT nFlags, CPoint point)
{
      // TODO: Add your message handler code here and/or call default
      CWnd::OnMouseMove(nFlags, point);
}

void CBitmapClient::OnLButtonUp(UINT nFlags, CPoint point)
{
      // TODO: Add your message handler code here and/or call default
      CWnd::OnLButtonUp(nFlags, point);
}


0
 

Author Comment

by:cjs
ID: 1316997
Thanks...


0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Replacement selected text 2 69
conditional code and condition difference 9 87
mapAB Challlenge 35 186
Is there a simple front-end menu system. 9 148
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question