diff --git a/G940LEDControl/Forms/MainFrm.dfm b/G940LEDControl/Forms/MainFrm.dfm index f7f6373..5f2a07a 100644 --- a/G940LEDControl/Forms/MainFrm.dfm +++ b/G940LEDControl/Forms/MainFrm.dfm @@ -8,6 +8,7 @@ object MainForm: TMainForm ClientHeight = 548 ClientWidth = 466 Color = clBtnFace + DefaultMonitor = dmDesktop Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 diff --git a/G940LEDControl/Forms/MainFrm.pas b/G940LEDControl/Forms/MainFrm.pas index 5ecabc1..c7e0808 100644 --- a/G940LEDControl/Forms/MainFrm.pas +++ b/G940LEDControl/Forms/MainFrm.pas @@ -827,7 +827,7 @@ end; procedure TMainForm.CMRestart(var Msg: TMessage); begin - ShellExecute(0, 'open', PChar(App.FileName), '/restart', PChar(App.Path), SW_SHOWMINNOACTIVE); + ShellExecute(0, 'open', PChar(App.FileName), '/restart', PChar(App.Path), SW_SHOWNOACTIVATE); Close; end; diff --git a/G940LEDControl/G940LEDControl.dpr b/G940LEDControl/G940LEDControl.dpr index 787d154..0d25542 100644 --- a/G940LEDControl/G940LEDControl.dpr +++ b/G940LEDControl/G940LEDControl.dpr @@ -3,6 +3,7 @@ program G940LEDControl; uses Forms, SysUtils, + Windows, X2UtSingleInstance, MainFrm in 'Forms\MainFrm.pas' {MainForm}, LogiJoystickDLL in '..\Shared\LogiJoystickDLL.pas', @@ -61,7 +62,12 @@ begin Application.Initialize; Application.MainFormOnTaskbar := True; + Application.ShowMainForm := not isRestarting; Application.Title := 'G940 LED Control'; Application.CreateForm(TMainForm, MainForm); + + if isRestarting then + MainForm.Visible := True; + Application.Run; end.