zoukankan      html  css  js  c++  java
  • Delphi启动过程追踪

    第一步:

    _InitExe windows调用Exe的入口

    _StartExe

    InitUnits

    第二步:

    InitControls的initialization部分

    TApplication.Create

    AllocateHWnd

    AllocateHWnd

    MakeObjectInstance

    StdWndProc

    Instance^.FMethod := TMethod(AMethod);

    AMethod==首次创建App时对应PopupControlProc

    PMethod = ^TMethod;
    ``TMethod = record Code, Data: Pointer; public class operator Equal(const Left, Right: TMethod): Boolean; inline; class operator NotEqual(const Left, Right: TMethod): Boolean; inline; class operator GreaterThan(const Left, Right: TMethod): Boolean; inline; class operator GreaterThanOrEqual(const Left, Right: TMethod): Boolean; inline; class operator LessThan(const Left, Right: TMethod): Boolean; inline; class operator LessThanOrEqual(const Left, Right: TMethod): Boolean; inline; end;

    第三部:

    • Application.Initialize;
    • Application.Run;

    第四步:

    • HandleMessage

    • TApplication.ProcessMessage

    • PeekMessage

    • TranslateMessage

    • DispatchMessageWi->

    • StdWndProc

    • TWinControl.MainWndProc

    • WindowProc: TWndMethod【TControl】

    • TControl.WndProc【初始化时指定FWindowProc := WndProc;】

    • TControl.WndProc

    • procedure TCustomForm.WndProc(var Message: TMessage);

    • 基于多态性调用父类TControl的WndProc

    • Dispatch->TObject.Dispath->消息回调函数

    • DefaultHandler

    项目编译时,跳过资源编译的编译选项

    <SkipResGeneration>true</SkipResGeneration>

  • 相关阅读:
    几种比较好看的颜色代码
    浅谈Express的put与del
    关于Linux软连接
    logstash根据日志关键词报警
    linux历史命令审计
    showdoc升级问题,showdoc错误日志
    以Docker容器的形式运行GVM-11
    主机标准化配置文档
    网络设备标准化配置文档
    Zabbix日常监控之lvs监控
  • 原文地址:https://www.cnblogs.com/windlog/p/12354270.html
Copyright © 2011-2022 走看看