Improvements and supplements to the article "in-depth MDI customer Window Programming"

Source: Internet
Author: User

Improvements and supplements to the article "in-depth MDI customer Window Programming"

Inventec group Electronic Technology Co., Ltd.
To the sea

---- I read the article "deep into MDI client Window Programming" published in your newspaper. I am very interested in this article. I think it is very good. The whole window is shown in (Omitted:

---- However, the disadvantage is that when I drag the MDI child window with the mouse, the situation shown in Figure 2 (Omitted) appears:

---- How can I erase the background? But when I minimize the entire framework window and restore it, the background of the customer window becomes normal again. How can this happen? Is there an error in vc6.0/5.0? No, this is because when we drag the MDI child window, the customer window does not reproduce the result in time. So how can we correct it? When dragging the subwindow with the mouse, we should send a message that redraws the background of the customer window to the main frame window in the current active subwindow. The onmove message processing function is added to the cchildframe using classward:

 
Void cchildframe: onmove (int x, int y) {javasichildwnd: onmove (x, y); // addedCodeBegincmdiframewnd * p_mframe = getmdiframe (); p_mframe-> postmessage (wm_paint); // Add code end}

---- Compile and run again. The problem just now is gone. Everything is fine. No matter how you drag the MDI subwindow, the background will not be erased.

---- However, there is another problem. When I move the mouse over the border of the MDI child window and drag the border to narrow the size of the MDI child window, figure 3 appears:

---- In the same way, when the size of the MDI sub-window changes, we also need to send a re-drawing background message to the main frame window using classward to add the onsize message processing function to cchildframe as follows:

 
Void cchildframe: onsize (uint ntype, int CX, int CY) {cmdichildwnd: onsize (ntype, CX, CY); // Add the code begincmdiframewnd * p_mframe = getmdiframe (); P _ mframe-> postmessage (wm_paint); // Add code end}

---- Re-compile and run, all of which are normal.

All rights reserved by China Computer World Publishing Service Co., Ltd.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.