Click to See Complete Forum and Search --> : Bitmap


April 29th, 1999, 10:02 PM
I want to display a bitmap on the background of the mainframe in an MDI application.

Could somebody help me...

Roland Seibert
April 30th, 1999, 12:54 AM
Subclass the CMDIClient member in CMainframe::OnCreateClient like this:

BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
if (CMDIFrameWnd::OnCreateClient(lpcs, pContext))
{
m_wndMdiClient.SubclassWindow(m_hWndMDIClient);
m_wndMdiClient.SetBitmap(IDB_MDI_BGND);
return TRUE;
}
else
return FALSE;
}

In this code m_wndMDIClient is a CWnd derived class (CMyMDIClient) which implemets the drawing of the background in CMyMDIClient::OnEraseBkgnd(). Here you can put your code to color the background or to display a bitmap.

Hope this helps

N garg
May 1st, 1999, 09:02 PM
Thanks itb worked.

nicobo
February 21st, 2006, 04:59 AM
How we can change the position of the bitmap ?

Thanks in advance ;)

Nico

nicobo
February 21st, 2006, 05:23 AM
Could somebody help me... ???