请教怎么设置一个Dialog的背景图片呢

请问如何设置一个Dialog的背景图片呢?
我做了一个Dialog,想为对话框添加一张背景图片,请问在哪里添加什么代码呢?
还有就是我在App的Inistance()里添加代码SetDialogBkColor(RGB(0, 0,255),RGB(0,255,255)); 每个窗口的背景色都变成上述代码的颜色了,请问如何能只改变一个特定的对话框的背景颜色呢?

------解决方案--------------------
在需要改变背景的窗口的OnPaint函数里面
 void CExampleDlgDlg::OnPaint() 
{
if (IsIconic())

else
{
CRect rect;
CPaintDC dc(this);
GetClientRect(rect);
dc.FillSolidRect(rect,RGB(0,255,0)); //设置为绿色背景

CDialog::OnPaint();
}


------解决方案--------------------
你参考下以下代码吧,以前做的:
BOOL CNewsDlg::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
CRect rect;
BITMAP bmp;
CDC dcCompatible;
m_bitmap.GetBitmap(&bmp); //m_bitmap 是CBitmap
dcCompatible.CreateCompatibleDC(pDC);
CBitmap *pOlBitmap = dcCompatible.SelectObject(&m_bitmap);
GetWindowRect(&rect);
pDC->SetStretchBltMode(COLORONCOLOR);
pDC->StretchBlt(0,0,rect.Width(),rect.Height(),&dcCompatible,
0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY);
dcCompatible.SelectObject(pOlBitmap);
DeleteDC(dcCompatible.m_hDC);

return TRUE; 
//return CDialog::OnEraseBkgnd(pDC);
}
------解决方案--------------------
1. 先载入一张图片,ID为IDB_BITMAP1

在TestDlg.h中 

CBrush m_brBk;//在public中定义 

TestDlg.cpp中 

在初始化函数OnInitDialog()中加入: 

BOOL CTestDlg::OnInitDialog() 

{ CDialog::OnInitDialog(); 

CBitmap bmp; 

bmp.LoadBitmap(IDB_BITMAP1); 

m_brBk.CreatePatternBrush(&bmp); 

bmp.DeleteObject(); 
return TRUE; // return TRUE unless you set the focus to a control 


在打开类向导,找到WM_CTLCOLOR消息,重载得对应函数OnCtlColor(),添加如下: 

HBRUSH CTestDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 


HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); 
if (pWnd == this) 


return m_brBk; 

return hbr; 

}