VCL中消息处理初探.docxVIP

  • 1
  • 0
  • 约5千字
  • 约 5页
  • 2022-07-30 发布于上海
  • 举报
VCL 中消息处理初探 TObject 是基类,所以我们先看一下TObject 的DISPATCH 方法。Dispatch 根据传入的message 来寻找相应的消息处理 方法,如果找不到的话,就继续向上到父类的消息处理方法表中寻找响应的处理方法,一直到找到为止,如果找到顶还没有,则调用DefaultHandle来处理该消息。message 可以是任何的类型,Dispatch 假设message 的头两位是消息的ID, 它就是根据ID 来寻找消息处理方法的。虽然任何类型的message 都可以被接受,但是TObject 的子类还是希望传入的message 参数是TMessage 的记录类型或其他证明的记录类型。 以下声明和注释摘自与system.pas: { TObject.Dispatch accepts any data type as its Message parameterT.he first 2 bytes of the data are taken as the message id to search for in the objects message methods.TDispatchMessage is an example of such a structure with a word field for the message id. TDispatchM

文档评论(0)

1亿VIP精品文档

相关文档