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