VCL里源码如下:
procedure TWinControl.WMParentNotify(var Message: TWMParentNotify); begin with Message do if (Event <> WM_CREATE) and (Event <> WM_DESTROY) or not DoControlMsg(Message.ChildWnd, Message) then inherited; end; function DoControlMsg(ControlHandle: HWnd; var Message): Boolean; var Control: TWinControl; begin DoControlMsg := False; Control := FindControl(ControlHandle); if Control <> nil then with TMessage(Message) do begin Result := Control.Perform(Msg + CN_BASE, WParam, LParam); DoControlMsg := True; end; end;