To add a message to a window WM_ERASEBKGND the handler function
VC6.0
1,
A. First, to add the OnEraseBkgnd function (WM_ERASEBKGND) for the convenience of using the erase background below
Press the shortcut key Ctrl+w Open ClassWizard dialog box (or menu->view->classwizard): Select Class Info, find the lower left corner of the MessageFilter, Drop-down list to the bottom, select window, OK save;
B. Let's ctrl+w Open the ClassWizard dialog box, Messagemaps->classname: Select the current Project dialog->objectids: Select the current dialog->messages: Drop it, wm_. Erasebkgnd have a bar, double-click or addfunction, add to the following member functions, double-click on the function code can be edited;
2, of course, in addition to the above methods, if the basic understanding of the code structure, you can also manually increase:
A, the project header file to increase the definition of background function erase
afx_msg BOOL OnEraseBkgnd (CDC *PDC);
b, increase the message response
Begin_message_map (C******dlg, CDialog)//c******dlg is your own dialog box of the engineering class
......
On_wm_erasebkgnd ()
End_message_map ()
C, Engineering source file CPP Add the Operations section of this function
Boolcdisplaybmpbackgrounddlg::onerasebkgnd (CDC *PDC)
{
Here you want to add those things to the background of the picture, just fill it out guohaiyang.blog.163.com
return TRUE;
}
VS2008:
1. In ' Resource View ', open a window, click in the window blank.
2. In the right property manager to select the Message page, will display all can add messages, find WM_ERASEBKGND, click the next Drop-down box, you will see Add OnEraseBkgnd item, click can successfully add WM_ERASEBKGND processing function
BOOL crtspsampledlg::onerasebkgnd (cdc* PDC)
{
TODO: Add the message Handler code here and/or call the default value
Return Cdialog::onerasebkgnd (PDC);
}
Note: VS2008 to manually add a message handler function is similar to VC6.
From the East son of the blog