Solved

Background Bitmap in CMDIFrameWnd

Posted on 1998-03-15
2
260 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

Independent Software Vendors: 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

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

623 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