Delphi 再看启动流程

本文详细解析了Delphi应用程序的启动流程,从Project.DPR文件的加载开始,介绍了系统初始化、单元模块初始化等过程,并深入探讨了关键组件如TApplication的创建及运行机制。

Project.DPR
InitExe
InitiateModule
StartExec
   SetExceptionHandler
   InitUnits
          sysInit
            System
               FPUMaskInit
               FPUInit
               系统相关GetVersion....
            Types
            Windows
            Messages
            ActiveX
            SysConst
            SysUtils
            VarUtils
            Variants
            RtlConsts
            TypInfo
            Classes
            Graphics...
            StdCtrls...
            Dialogs....
            Controls...
            Forms
TApplication.Iniatiate
TApplication.CreateForm
TApplication.Run

[SysUtils]
InitExceptions;
[Variants]
InitializeCriticalSection(LVarTypeSync);
[classes]
InitThreadSynchronization;
AddModuleUnloadProc(ModuleUnload);
GlobalNameSpace := TMultiReadExclusiveWriteSynchronizer.Create;
RegGroups := TRegGroups.Create;
IntConstList := TThreadList.Create;
GlobalFixupList := TThreadList.Create;
[grapics.pas]
InitScreenLogPixels;
InitializeCriticalSection(BitmapImageLock);
InitializeCriticalSection(CounterLock);
StockPen := GetStockObject(BLACK_PEN);
StockBrush := GetStockObject(HOLLOW_BRUSH);
StockFont := GetStockObject(SYSTEM_FONT);
StockIcon := LoadIcon(0, IDI_APPLICATION);
InitDefFontData;
FontManager := TResourceManager.Create(SizeOf(TFontData));
PenManager := TResourceManager.Create(SizeOf(TPenData));
BrushManager := TResourceManager.Create(SizeOf(TBrushData));
PatternManager := TPatternManager.Create;
BitmapCanvasList := TThreadList.Create;
CanvasList := TThreadList.Create;
RegisterIntegerConsts(TypeInfo(TColor), IdentToColor, ColorToIdent);
RegisterIntegerConsts(TypeInfo(TFontCharset), IdentToCharset, CharsetToIdent);
[Controls.pas]
NewStyleControls := Lo(GetVersion) >= 4;
InitControls;
Mouse.create
Screen.create
Application.create
StartClassGroup(TControl);
ActivateClassGroup(TControl);
GroupDescendentsWith(TCustomImageList, TControl);
GroupDescendentsWith(TContainedAction, TControl);
GroupDescendentsWith(TCustomActionList, TControl);
[Forms]
InitProcs;
RM_TaskBarCreated := RegisterWindowMessage('TaskbarCreated');
Classes.RegisterFindGlobalComponentProc(FindGlobalComponent);
[Dialogs.pas]
InitGlobals;
StartClassGroup(TControl);
ActivateClassGroup(TControl);
GroupDescendentsWith(TCommonDialog, TControl);
[Project]
Application.Initiate
Application.CreateForm
Application.Run

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值