Draw a rectangle on the MFC dialog box. How can I move the rectangle following the dialog box?

Source: Internet
Author: User

I show the video in the MFC dialog box, and then draw a rectangle in onpaint. Then I drag the dialog box to find that the rectangle is still fixed at the position on the screen and cannot be dragged along with the dialog box, in addition, when another page overwrites the dialog box, the rectangle is drawn to another page, and the dialog box is minimized. The rectangle is also painted on other pages below, with a high finger:

I just want to bind the dialog box to the rectangle drawn. The dialog box moves and the rectangle moves. When the dialog box is overwritten, the rectangle will also be overwritten, as if the rectangle drawn is a part of the dialog box.

 

 

A morning later, I found that the window handle was incorrect.

Http://topic.csdn.net/u/20120322/09/fe369577-bd8c-4b1d-bffe-0cf7dcb26470.html? Seed = 276010730 & R = 77986790 # r_77986790

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.