mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-21 12:19:15 +12:00
Add Feature pt2
This commit is contained in:
parent
092534e331
commit
67275262fb
36 changed files with 1555 additions and 296 deletions
65
HorseIsleServer/N00BS/SystemTrayIcon.cs
Normal file
65
HorseIsleServer/N00BS/SystemTrayIcon.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue