mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-26 15:15:57 -05:00
Fix the logoff/shutdown bug.
This commit is contained in:
parent
63b021a47e
commit
4f01d784dc
@ -59,13 +59,14 @@ namespace FireflyConfig
|
||||
|
||||
private System.ServiceProcess.ServiceController scFirefly;
|
||||
private ServiceStatus iState = ServiceStatus.Unintialized;
|
||||
private bool closeFromMenu = false;
|
||||
|
||||
private string strPort;
|
||||
private string strServerName;
|
||||
private string strMusicDir;
|
||||
private string strPassword;
|
||||
|
||||
private bool ForceExit = false;
|
||||
|
||||
private System.IntPtr PipeHandle;
|
||||
private System.IO.FileStream mPipeStream;
|
||||
private byte[] PipeBuffer;
|
||||
@ -93,6 +94,15 @@ namespace FireflyConfig
|
||||
private System.Windows.Forms.CheckBox checkBoxPassword;
|
||||
private System.ComponentModel.IContainer components;
|
||||
|
||||
protected override void WndProc(ref Message msg)
|
||||
{
|
||||
if(msg.Msg == 0x11) // WM_QUERYENDSESSION
|
||||
{
|
||||
ForceExit = true;
|
||||
}
|
||||
base.WndProc(ref msg);
|
||||
}
|
||||
|
||||
public void ServiceStatusUpdate()
|
||||
{
|
||||
scFirefly.Refresh();
|
||||
@ -468,6 +478,7 @@ namespace FireflyConfig
|
||||
this.Text = "Configuration";
|
||||
this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
|
||||
this.Resize += new System.EventHandler(this.FireflyConfig_Resize);
|
||||
this.Closing += new System.ComponentModel.CancelEventHandler(this.FireflyConfig_Closing);
|
||||
this.Load += new System.EventHandler(this.FireflyConfig_Load);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
@ -502,7 +513,7 @@ namespace FireflyConfig
|
||||
|
||||
private void menuItemExit_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
closeFromMenu = true;
|
||||
ForceExit = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
@ -612,6 +623,12 @@ namespace FireflyConfig
|
||||
}
|
||||
}
|
||||
|
||||
private void FireflyConfig_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
if(!ForceExit)
|
||||
e.Cancel = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
|
@ -307,12 +307,12 @@
|
||||
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="$this.Name">
|
||||
<value>FireflyConfig</value>
|
||||
</data>
|
||||
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>8, 8</value>
|
||||
</data>
|
||||
|
Loading…
Reference in New Issue
Block a user