Skip to content

Commit 31e3a2a

Browse files
committed
Force first run config dialogue to display task button.
Adding WS_EX_APPWINDOW` flag to window creation params enabled the task bar button to be displayed. The reason for this is that the dialogue is displayed before the main CodeSnip window, so the is no CodeSnip task bar button displayed yet. This forces a task b
1 parent 43a3220 commit 31e3a2a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Src/FirstRun.FmV4ConfigDlg.pas

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ TAligner = class(TInterfacedObject, IFormAligner)
114114
procedure AlignForm(const AForm: TCustomForm);
115115
end;
116116
strict protected
117+
/// <summary>Modifies window creation parameters to ensure the dialgue box
118+
/// displays a button in the task bar.</summary>
119+
/// <remarks>This is necessary because the dialogue box is displayed before
120+
/// CodeSnip's main window is shown, so there is no suitable button
121+
/// displayed yet.</remarks>
122+
procedure CreateParams(var Params: TCreateParams); override;
117123
/// <summary>Returns instance of form aligner object.</summary>
118124
function GetAligner: IFormAligner; override;
119125
/// <summary>Arranges controls within each tab sheet.</summary>
@@ -159,6 +165,8 @@ implementation
159165

160166

161167
uses
168+
// VCL
169+
Windows,
162170
// Project
163171
UConsts, UCtrlArranger, UMessageBox, UStructs;
164172

@@ -268,6 +276,12 @@ procedure TV4ConfigDlg.CreateBulletPage(TS: TTabSheet;
268276
end;
269277
end;
270278

279+
procedure TV4ConfigDlg.CreateParams(var Params: TCreateParams);
280+
begin
281+
inherited;
282+
Params.ExStyle := Params.ExStyle OR WS_EX_APPWINDOW;
283+
end;
284+
271285
function TV4ConfigDlg.DatabaseAvailable: Boolean;
272286
begin
273287
Result := fFirstRun.HaveOldUserDB;

0 commit comments

Comments
 (0)