|
How do I set the background image in the dialog box? After searching the Internet, I found this method:
Overload WM_ERASEBKGND message mapping function OnEraseBkgnd (CDC * pDC)
BOOL CMPlayerDlg :: OnEraseBkgnd (CDC * pDC)
{
CDC memDC;
CBitmap MPlayer;
if (! MPlayer.LoadBitmap (IDB_MPLAYER))
return FALSE;
memDC.CreateCompatibleDC (pDC);
CBitmap * pOldBmp = memDC.SelectObject (&MPlayer);
pDC-> BitBlt (0,0, MPLAYERWIDTH, MPLAYEREXT,&memDC, 0,0, SRCCOPY);
memDC.SelectObject (pOldBmp);
return TRUE;
}
However, I can only implement it in a single document.I cannot implement it in the dialog box because the WM_ERASEBKGND message cannot be found.
Is there a better way to set the background image in the dialog box? |
|