Windows has its own controls (such as TButton) most of the messages are handled by itself, and Delphi covers so many wm_ functions with lower priority, which is generally not

Source: Internet
Author: User

Put a tbutton on the empty form, a tpanel, and then put the breakpoint in the TWINCONTROL.WMERASEBKGND:

procedureTWINCONTROL.WMERASEBKGND (varmessage:twmerasebkgnd);begin   withThemeservicesdo //The breakpoint here   ifThemesenabled andAssigned (Parent) and(CsparentbackgroundinchFcontrolstyle) Then    begin      {Get The parent to draw it background into the control ' s background.}Drawparentbackground (Handle, MESSAGE.DC,Nil, False); End    Else    begin      {Only erase background if we ' re not doublebuffering or painting to memory.}      if  notFdoublebufferedor(Tmessage (Message). WParam= Tmessage (Message). LParam) ThenFillRect (MESSAGE.DC, Clientrect, Fbrush.handle); End; Message.result:=1;End;

Click Run, found that the program two times to stay on the breakpoint, in the observation window input self.name, found that is Form1 and Panel1, and no Button1 stop here.

Windows has its own controls (such as TButton) most of the messages are handled by itself, and Delphi covers so many wm_ functions with lower priority, which is generally not

Related Article

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.