Relationship between beautification interface messages

Source: Internet
Author: User

ReferenceArticle: Bai Qiao Original: Beautification interface of VC

 
1. Relationship between wm_paint and wm_erasebkgnd messagesAccording to Win32 knowledge, in the message processing function of wm_paint, you must call beginpaint before painting. The beginpaint function sends the wm_erasebkgnd message (sendmessage), that is, it directly calls the message processing function to process the wm_erasebkgnd message. By default, defwindowproc processes wm_erasebkgnd and refreshes the customer area, that is, the background, which is registered in the window. Note: Of course, by calling invalidaterect (CodeGenerate wm_paint message) bool invalidaterect (hwnd, // handle to window const rect * lprect, // rectangle coordinates bool berase // erase State); to generate wm_paint message, you can specify the berase to false so that wm_erasebkgnd messages are not sent in beginpaint.
  2. the following figure shows the process of beautifying the page message:  
 wm_paint {wm_erasebkgnd // brush background {wm_ctlcolor // obtain the paint brush for the brush background, if the message is not sent, the image brush {......} registered in the window will be used by default {......}... brush background ...} wm_ctlcolor // set text-related features, such as font, foreground color, and background color... {......} // start to draw {...... // draw a specific item 1 {nm_customdraw // some properties customized by the  Program  )}. ..... // draw a specific item 2 {nm_customdraw // some attributes customized by the programmer {} Specific Drawing (not open )}......}} 

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.