mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-10 14:09:51 -05:00
Fix the logoff/shutdown bug.
This commit is contained in:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user