Add Feature pt2

This commit is contained in:
Silica 2022-03-08 10:59:30 -05:00
parent 092534e331
commit 67275262fb
36 changed files with 1555 additions and 296 deletions

View file

@ -0,0 +1,65 @@
using HISP.Server;
using System;
using System.Diagnostics;
using System.Windows.Forms;
namespace HISP
{
public partial class SystemTrayIcon : Form
{
Process clientProcess = new Process();
public SystemTrayIcon()
{
InitializeComponent();
}
private void createNewUserToolStripMenuItem_Click(object sender, EventArgs e)
{
RegisterForm frm = new RegisterForm();
frm.ShowDialog();
}
private void closeServerToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void SystemTrayIcon_Load(object sender, EventArgs e)
{
clientProcess.StartInfo.FileName = "flash.dll";
clientProcess.StartInfo.Arguments = "http://127.0.0.1/horseisle.swf?SERVER=127.0.0.1&PORT=12321";
clientProcess.StartInfo.RedirectStandardOutput = true;
clientProcess.StartInfo.RedirectStandardError = true;
clientProcess.EnableRaisingEvents = true;
clientProcess.Exited += clientExited;
clientProcess.Start();
}
private void clientExited(object sender, EventArgs e)
{
if (this.InvokeRequired)
{
this.Invoke(() =>
{
this.Close();
});
}
else
{
this.Close();
}
}
private void SystemTrayIcon_FormClosing(object sender, FormClosingEventArgs e)
{
HispNotifyIcon.Visible = false;
clientProcess.Kill();
}
}
}