經過選擇【Project | View Source】,能夠看到DPR文件的基本面貌,操做以下:html
默認的 Delphi 項目文件的內容以下:app
program Project1; {關鍵字 program} uses {uses 單元引用} Vcl.Forms, //新的單元名稱VCL限定 Unit1 in 'Unit1.pas' {Form1}; {$R *.res} begin Application.Initialize; Application.MainFormOnTaskbar := True; {默認已經MainForm顯示於任務欄,而不是以前版本的Application} Application.CreateForm(TForm1, Form1); Application.Run; end.
經過查看官方的幫助文件,咱們來了解下 Application.MainFormOnTaskbar 的含義,官方解釋以下:ui
The MainFormOnTaskBar property controls how Windows taskbar buttons are handled by VCL. this
If the property is true, a taskbar button represents the application's main form and displays its caption. If false, a taskbar button represents the application's (hidden) main window and bears the application's Title. spa
MainFormOnTaskBar must be true to use Windows Vista Aero effects. These include live taskbar thumbnails, Dynamic Windows, Windows Flip, and Windows Flip 3D. code
If a change to default behavior is required, MainFormOnTaskBar should be set in the .dpr file after Application.Initialize and before main form creation. The MainFormOnTaskBar setting is intended to persist for the life of the application; later runtime changes of this property could result in unexpected behavior. orm
MainFormOnTaskBar defaults to True for applications created in Delphi 2007 and later products and False for earlier products. htm
The property can be applied to older applications. Note that it affects the Z-order of your MainForm in case your application depends on this. blog
To update existing VCL applications, add the following line to the project's .dpr file after Application.Initialize;: ip
This line is automatically added to new projects.