From ba31a083320d4b56d779bf13cc19aacf6ed9c001 Mon Sep 17 00:00:00 2001 From: Jarr3 Date: Sat, 4 Nov 2023 13:04:39 +0100 Subject: [PATCH] #49 It should also not force the windows in front when started from explorer --- .../Classes/B2SScreen.vb | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/b2sbackglassserverexe/b2sbackglassserverexe/Classes/B2SScreen.vb b/b2sbackglassserverexe/b2sbackglassserverexe/Classes/B2SScreen.vb index b326ff5..1616586 100644 --- a/b2sbackglassserverexe/b2sbackglassserverexe/Classes/B2SScreen.vb +++ b/b2sbackglassserverexe/b2sbackglassserverexe/Classes/B2SScreen.vb @@ -420,18 +420,19 @@ Public Class B2SScreen Me.formbackground.BackgroundImage = Image.FromFile(Me.BackgroundPath) ' ("C:\backglass.png") End If Me.formbackground.Show() - If B2SSettings.FormToBack Then - Me.formbackground.SendToBack() - Me.formbackground.ShowInTaskbar = False - ElseIf B2SSettings.FormToFront Then - Me.formbackground.BringToFront() - Me.formbackground.TopMost = True - If B2SSettings.FormNoFocus Then Me.formbackground.ShowInTaskbar = False - Else - Me.formbackground.BringToFront() + If Not B2SSettings.PureEXE Then + If B2SSettings.FormToBack Then + Me.formbackground.SendToBack() + Me.formbackground.ShowInTaskbar = False + ElseIf B2SSettings.FormToFront Then + Me.formbackground.BringToFront() + Me.formbackground.TopMost = True + If B2SSettings.FormNoFocus Then Me.formbackground.ShowInTaskbar = False + Else + Me.formbackground.BringToFront() + End If End If End If - ' set forms to background image size If formBackglass IsNot Nothing AndAlso formBackglass.BackgroundImage IsNot Nothing Then formBackglass.Size = formBackglass.BackgroundImage.Size @@ -483,17 +484,19 @@ Public Class B2SScreen formBackglass.Location = Me.BackglassScreen.Bounds.Location + Me.BackglassLocation formBackglass.Size = Me.BackglassSize - If B2SSettings.FormToFront Then - ' bring backglass screen to the front and force it to stay - formBackglass.TopMost = True - formBackglass.BringToFront() - If B2SSettings.FormNoFocus Then formBackglass.ShowInTaskbar = False - ElseIf B2SSettings.FormToBack Then - ' bring backglass screen to the back and force it to stay - formBackglass.SendToBack() - formBackglass.ShowInTaskbar = False - Else - formBackglass.BringToFront() + If Not B2SSettings.PureEXE Then + If B2SSettings.FormToFront Then + ' bring backglass screen to the front and force it to stay + formBackglass.TopMost = True + formBackglass.BringToFront() + If B2SSettings.FormNoFocus Then formBackglass.ShowInTaskbar = False + ElseIf B2SSettings.FormToBack Then + ' bring backglass screen to the back and force it to stay + formBackglass.SendToBack() + formBackglass.ShowInTaskbar = False + Else + formBackglass.BringToFront() + End If End If If StartBackground Then