Skip to content

Commit

Permalink
Swap order in BringToFrontAndRestore support function to work around …
Browse files Browse the repository at this point in the history
…VCL bug.


If Application.BringToFront is called while the app is minimized, the Forms unit's WM_ACTIVATEAPP handler inexplicably sets FAppIconic=False, which causes the next Application.Restore call to be a no-op.
  • Loading branch information
jordanrussell authored Dec 18, 2024
1 parent f9d5475 commit f6f2f17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Projects/Src/Setup.ScriptFunc.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1587,8 +1587,9 @@ procedure ScriptFuncLibraryRegister_R(ScriptInterpreter: TPSExec);
begin
RegisterScriptFunc('BRINGTOFRONTANDRESTORE', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
begin
Application.BringToFront;
{ Must be in this order to work around VCL bug }
Application.Restore;
Application.BringToFront;
end);
RegisterScriptFunc('WizardDirValue', sfNoUninstall, procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
begin
Expand Down

0 comments on commit f6f2f17

Please sign in to comment.