Improvement and supplementation of the "In-depth MDI Customer Window Programming" one-in-British Group Electronic Technology Co., Ltd. to the sea ---- I have seen the article "In-depth MDI Customer Window Programming", which is published, quite interest, actually operated once I feel that the whole window is as shown in Figure 1 (): ---- However, the beauty is not enough, when I drag the MDI child window with the mouse: --- - How did I wipe it? But when I minimize the entire frame window, when I restore it, the background of the customer window will return to normal, how can this look? Is it an error wrong with VC6.0 / 5.0? No, this is because we are dragging the MDI sub-window, the customer window does not have timely redraw the result, what should I correct? When you use a mouse to drag the sub-window, we should let the current Active Substall to send a message to the main frame window. Use Classward to join the ONMOVE message processing function in cchildframe: void cchildframe :: ONMOVE (INT X) Int Y)
{
CmdichildWnd :: OnMove (x, y);
// Add code Begin
CmdiframeWnd * p_mframe = getmdiframe ();
P_mframe-> postmessage (wm_paint);
// Add code end
}
---- Compile, run, just now, there is nothing, everything is fine, no matter how to drag the MDI sub-window, the background will not be wiped up. ---- However, there is a problem, when I put the mouse on the border of the MDI sub-window, and drag the border to reduce the size of the MDI sub-window, there is a three-view situation: ---- the same The truth, when the size of the MDI sub-window changes, we have to send a message to the main frame window to use Classward to join the onsize message processing function in cchildframe: void cchildframe :: Onsize (uint ntype, int Cx, int CY)
{
CmdichildWnd :: Onsize (NTYPE, CX, CY);
// Add code Begin
CmdiframeWnd * p_mframe = getmdiframe ();
P_ mframe -> PostM_Paint);
// Add code end
}
---- Compile, run, all normal.
China Computer World Publishing Service Company Copyright