[WIP] Working notifyIcon during run

notifyIcon works if run from Shortcutlibrary,
or from clicked shortcut. Next step is to make
the main window show some sort of indication
that the UI is locked until the game exits....
This commit is contained in:
Terry MacDonald 2020-11-19 22:40:08 +13:00
parent 699d7ec209
commit e9a821e594
11 changed files with 8252 additions and 181 deletions

View File

@ -733,7 +733,7 @@ namespace HeliosPlus.Shared
myPhysicalGPU.Foundry.ToString(),
myPhysicalGPU.GPUId.ToString(),
myPhysicalGPU.GPUType.ToString(),
aDisplayDevice.Output.OutputId.ToString(),
//aDisplayDevice.Output.OutputId.ToString(),
aDisplayDevice.ConnectionType.ToString(),
aDisplayDevice.DisplayId.ToString(),
};

View File

@ -100,6 +100,12 @@
<Compile Include="UIForms\ApplyingProfileForm.Designer.cs">
<DependentUpon>ApplyingProfileForm.cs</DependentUpon>
</Compile>
<Compile Include="UIForms\WaitingForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UIForms\WaitingForm.Designer.cs">
<DependentUpon>WaitingForm.cs</DependentUpon>
</Compile>
<Compile Include="UIForms\ShortcutAdaptor.cs" />
<Compile Include="UIForms\ProfileAdaptor.cs" />
<Compile Include="UIForms\MainForm.cs">
@ -154,6 +160,9 @@
<EmbeddedResource Include="UIForms\ApplyingProfileForm.resx">
<DependentUpon>ApplyingProfileForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UIForms\WaitingForm.resx">
<DependentUpon>WaitingForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UIForms\MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
<SubType>Designer</SubType>

View File

@ -42,6 +42,7 @@ namespace HeliosPlus {
public static string AppSteamIconFilename = Path.Combine(AppIconPath, @"Steam.ico");
public static string AppUplayIconFilename = Path.Combine(AppIconPath, @"Uplay.ico");
public static string AppEpicIconFilename = Path.Combine(AppIconPath, @"Epic.ico");
public static bool WaitingForGameToExit = false;
public static ProgramSettings AppProgramSettings;
/// <summary>

View File

@ -454,9 +454,8 @@ namespace HeliosPlus
return false;
}
// ReSharper disable once CyclomaticComplexity
public static void RunShortcut(ShortcutItem shortcutToUse)
public static void RunShortcut(ShortcutItem shortcutToUse, NotifyIcon notifyIcon = null)
{
// Do some validation to make sure the shortcut is sensible
// And that we have enough to try and action within the shortcut
@ -519,6 +518,57 @@ namespace HeliosPlus
}
}
// Add a status notification icon in the status area
// but only if we are going to wait for a process to finish
string oldNotifyText = "";
bool temporaryNotifyIcon = false;
ContextMenuStrip oldContextMenuStrip = null;
// If we're running the shortcut from the ShortcutLibrary
// then we get given the NotifyIcon through the function
// parameters i.e. if temporaryIcon is false in that case.
// This means we need to save the state if the temporaryIcon
// is false.
// Conversely, if temporaryIcon is true, then we need
// to create a NotifyIncon as MainFOrm isn't running to create
// one for us already!
if (notifyIcon == null)
temporaryNotifyIcon = true;
if (temporaryNotifyIcon)
{
if (!shortcutToUse.Category.Equals(ShortcutCategory.NoGame))
{
try
{
notifyIcon = new NotifyIcon
{
Icon = Properties.Resources.HeliosPlus,
//Text = string.Format("HeliosPlus: Waiting for the Game {} to exit...", steamGameToRun.Name),
Visible = true
};
Application.DoEvents();
}
catch (Exception ex)
{
Console.WriteLine($"ShortcutRepository/RunShortcut exception: Trying to {ex.Message}: {ex.StackTrace} - {ex.InnerException}");
// ignored
}
}
}
else
{
// If we reach here then we're running the shortcut
// from the ShortcutLibrary window, so we need to
// remember what the text was so we can return it to
// normal after we're done!
oldNotifyText = notifyIcon.Text;
oldContextMenuStrip = notifyIcon.ContextMenuStrip;
notifyIcon.ContextMenuStrip = null;
Application.DoEvents();
}
// Now start the main game, and wait if we have to
if (shortcutToUse.Category.Equals(ShortcutCategory.Application))
{
@ -568,25 +618,8 @@ namespace HeliosPlus
IPCService.GetInstance().HoldProcessId = processesToMonitor.FirstOrDefault()?.Id ?? 0;
IPCService.GetInstance().Status = InstanceStatus.OnHold;
// Add a status notification icon in the status area
NotifyIcon notify = null;
try
{
notify = new NotifyIcon
{
Icon = Properties.Resources.HeliosPlus,
Text = string.Format(
Language.Waiting_for_the_0_to_terminate,
processesToMonitor[0].ProcessName),
Visible = true
};
notifyIcon.Text = $"HeliosPlus: Waiting for the Application {processesToMonitor[0].ProcessName} to exit...";
Application.DoEvents();
}
catch (Exception ex)
{
Console.WriteLine($"ShortcutItem/Run exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}");
// ignored
}
// Wait for the monitored process to exit
foreach (var p in processesToMonitor)
@ -597,20 +630,11 @@ namespace HeliosPlus
}
catch (Exception ex)
{
Console.WriteLine($"ShortcutItem/Run exception 2: {ex.Message}: {ex.StackTrace} - {ex.InnerException}");
Console.WriteLine($"ShortcutRepository/RunShortcut exception 2: {ex.Message}: {ex.StackTrace} - {ex.InnerException}");
// ignored
}
}
// Remove the status notification icon from the status area
// once we've existed the game
if (notify != null)
{
notify.Visible = false;
notify.Dispose();
Application.DoEvents();
}
}
else if (shortcutToUse.Category.Equals(ShortcutCategory.Game))
{
@ -657,26 +681,9 @@ namespace HeliosPlus
IPCService.GetInstance().HoldProcessId = steamProcess?.Id ?? 0;
IPCService.GetInstance().Status = InstanceStatus.OnHold;
/*// Add a status notification icon in the status area
NotifyIcon notify = null;
try
{
notify = new NotifyIcon
{
Icon = Properties.Resources.HeliosPlus,
Text = string.Format(
Language.Waiting_for_the_0_to_terminate,
steamGameToRun.GameName),
Visible = true
};
// Add a status notification icon in the status area
notifyIcon.Text = $"HeliosPlus: Waiting for the Game {steamGameToRun.Name} to exit...";
Application.DoEvents();
}
catch (Exception ex)
{
Console.WriteLine($"Program/SwitchToSteamGame exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}");
// ignored
}*/
// Wait 300ms for the game process to spawn
Thread.Sleep(300);
@ -697,15 +704,6 @@ namespace HeliosPlus
Console.WriteLine($"{steamGameToRun.Name} has exited.");
}
// Remove the status notification icon from the status area
// once we've exited the game
/*if (notify != null)
{
notify.Visible = false;
notify.Dispose();
Application.DoEvents();
}*/
}
}
@ -755,26 +753,9 @@ namespace HeliosPlus
IPCService.GetInstance().HoldProcessId = uplayProcess?.Id ?? 0;
IPCService.GetInstance().Status = InstanceStatus.OnHold;
/*// Add a status notification icon in the status area
NotifyIcon notify = null;
try
{
notify = new NotifyIcon
{
Icon = Properties.Resources.HeliosPlus,
Text = string.Format(
Language.Waiting_for_the_0_to_terminate,
steamGameToRun.GameName),
Visible = true
};
// Add a status notification icon in the status area
notifyIcon.Text = $"HeliosPlus: Waiting for the Game {uplayGameToRun.Name} to exit...";
Application.DoEvents();
}
catch (Exception ex)
{
Console.WriteLine($"Program/SwitchToSteamGame exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}");
// ignored
}*/
// Wait 300ms for the game process to spawn
Thread.Sleep(300);
@ -795,20 +776,34 @@ namespace HeliosPlus
Console.WriteLine($"{uplayGameToRun.Name} has exited.");
}
}
}
}
// Remove the status notification icon from the status area
// once we've exited the game
/*if (notify != null)
// once we've exited the game, but only if its a game or app
if (temporaryNotifyIcon)
{
notify.Visible = false;
notify.Dispose();
if (!shortcutToUse.Category.Equals(ShortcutCategory.NoGame))
{
if (notifyIcon != null)
{
notifyIcon.Visible = false;
notifyIcon.Dispose();
Application.DoEvents();
}*/
}
}
}
else
{
// If we're running the shortcut from the ShortcutLibrary
// then we want to reset the NotifyIcon back
notifyIcon.Text = oldNotifyText;
notifyIcon.ContextMenuStrip = oldContextMenuStrip;
Application.DoEvents();
}
// Stop the pre-started startPrograms that we'd started earlier
if (startProgramsToStop.Count > 0)

View File

@ -33,6 +33,7 @@
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.btn_setup_display_profiles = new System.Windows.Forms.Button();
this.pb_display_profile = new System.Windows.Forms.PictureBox();
this.cb_minimise_notification_area = new System.Windows.Forms.CheckBox();
this.lbl_version = new System.Windows.Forms.Label();
this.btn_setup_game_shortcuts = new System.Windows.Forms.Button();
this.btn_exit = new System.Windows.Forms.Button();
@ -50,7 +51,6 @@
this.shortcutToolStripSeparator = new System.Windows.Forms.ToolStripSeparator();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.cb_minimise_notification_area = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@ -97,6 +97,14 @@
this.pb_display_profile.TabStop = false;
this.pb_display_profile.Click += new System.EventHandler(this.pb_display_profile_Click);
//
// cb_minimise_notification_area
//
resources.ApplyResources(this.cb_minimise_notification_area, "cb_minimise_notification_area");
this.cb_minimise_notification_area.ForeColor = System.Drawing.Color.White;
this.cb_minimise_notification_area.Name = "cb_minimise_notification_area";
this.cb_minimise_notification_area.UseVisualStyleBackColor = true;
this.cb_minimise_notification_area.CheckedChanged += new System.EventHandler(this.cb_minimise_notification_area_CheckedChanged);
//
// lbl_version
//
resources.ApplyResources(this.lbl_version, "lbl_version");
@ -213,14 +221,6 @@
resources.ApplyResources(this.exitToolStripMenuItem, "exitToolStripMenuItem");
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
//
// cb_minimise_notification_area
//
resources.ApplyResources(this.cb_minimise_notification_area, "cb_minimise_notification_area");
this.cb_minimise_notification_area.ForeColor = System.Drawing.Color.White;
this.cb_minimise_notification_area.Name = "cb_minimise_notification_area";
this.cb_minimise_notification_area.UseVisualStyleBackColor = true;
this.cb_minimise_notification_area.CheckedChanged += new System.EventHandler(this.cb_minimise_notification_area_CheckedChanged);
//
// MainForm
//
resources.ApplyResources(this, "$this");
@ -252,7 +252,6 @@
private System.Windows.Forms.Button btn_setup_display_profiles;
private System.Windows.Forms.Button btn_setup_game_shortcuts;
private System.Windows.Forms.Label lbl_version;
private System.Windows.Forms.NotifyIcon notifyIcon;
private System.Windows.Forms.ContextMenuStrip mainContextMenuStrip;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemHeading;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator;
@ -266,5 +265,6 @@
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.CheckBox cb_minimise_notification_area;
public System.Windows.Forms.NotifyIcon notifyIcon;
}
}

View File

@ -28,8 +28,13 @@ namespace HeliosPlus.UIForms
btn_setup_game_shortcuts.Parent = splitContainer1.Panel2;
lbl_version.Text = string.Format(lbl_version.Text, Assembly.GetExecutingAssembly().GetName().Version);
notifyIcon.Visible = true;
notifyIcon.ContextMenuStrip = mainContextMenuStrip;
RefreshNotifyIconMenus();
/*WaitingForm testform = new WaitingForm();
testform.Owner = this;
testform.Show();*/
if (Program.AppProgramSettings.MinimiseOnStart)
{
// Make the form minimised on start
@ -181,7 +186,7 @@ namespace HeliosPlus.UIForms
// Run the shortcut if it's still there
if (shortcutToRun != null)
ShortcutRepository.RunShortcut(shortcutToRun);
ShortcutRepository.RunShortcut(shortcutToRun, notifyIcon);
}
}
@ -233,5 +238,6 @@ namespace HeliosPlus.UIForms
ShowWindow(Handle, SW_RESTORE);
}
}
}
}

View File

@ -10738,7 +10738,7 @@
<value>NoControl</value>
</data>
<data name="cb_minimise_notification_area.Location" type="System.Drawing.Point, System.Drawing">
<value>245, 351</value>
<value>245, 354</value>
</data>
<data name="cb_minimise_notification_area.Size" type="System.Drawing.Size, System.Drawing">
<value>296, 20</value>
@ -10771,7 +10771,7 @@
<value>Microsoft Sans Serif, 9.75pt</value>
</data>
<data name="lbl_version.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 353</value>
<value>12, 356</value>
</data>
<data name="lbl_version.Size" type="System.Drawing.Size, System.Drawing">
<value>25, 16</value>
@ -10807,7 +10807,7 @@
<value>Microsoft Sans Serif, 21.75pt</value>
</data>
<data name="btn_setup_game_shortcuts.Location" type="System.Drawing.Point, System.Drawing">
<value>212, 182</value>
<value>212, 184</value>
</data>
<data name="btn_setup_game_shortcuts.Size" type="System.Drawing.Size, System.Drawing">
<value>360, 50</value>
@ -10840,7 +10840,7 @@
<value>NoControl</value>
</data>
<data name="btn_exit.Location" type="System.Drawing.Point, System.Drawing">
<value>698, 349</value>
<value>698, 352</value>
</data>
<data name="btn_exit.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
@ -63196,81 +63196,6 @@
<metadata name="mainContextMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>152, 17</value>
</metadata>
<data name="toolStripMenuItemHeading.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="toolStripMenuItemHeading.Font" type="System.Drawing.Font, System.Drawing">
<value>Segoe UI, 9pt, style=Italic</value>
</data>
<data name="toolStripMenuItemHeading.Size" type="System.Drawing.Size, System.Drawing">
<value>218, 22</value>
</data>
<data name="toolStripMenuItemHeading.Text" xml:space="preserve">
<value>HeliosPlus</value>
</data>
<data name="toolStripSeparator.Size" type="System.Drawing.Size, System.Drawing">
<value>215, 6</value>
</data>
<data name="openApplicationWindowToolStripMenuItem.Font" type="System.Drawing.Font, System.Drawing">
<value>Segoe UI, 9pt, style=Bold</value>
</data>
<data name="openApplicationWindowToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>218, 22</value>
</data>
<data name="openApplicationWindowToolStripMenuItem.Text" xml:space="preserve">
<value>Open Application Window</value>
</data>
<data name="profilesToolStripMenuItemHeading.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="profilesToolStripMenuItemHeading.Font" type="System.Drawing.Font, System.Drawing">
<value>Segoe UI, 9pt, style=Italic</value>
</data>
<data name="profilesToolStripMenuItemHeading.Size" type="System.Drawing.Size, System.Drawing">
<value>155, 22</value>
</data>
<data name="profilesToolStripMenuItemHeading.Text" xml:space="preserve">
<value>Display Profiles</value>
</data>
<data name="profileToolStripSeparator.Size" type="System.Drawing.Size, System.Drawing">
<value>152, 6</value>
</data>
<data name="profileToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>218, 22</value>
</data>
<data name="profileToolStripMenuItem.Text" xml:space="preserve">
<value>Change Display Profile</value>
</data>
<data name="shortcutsToolStripMenuItemHeading.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="shortcutsToolStripMenuItemHeading.Font" type="System.Drawing.Font, System.Drawing">
<value>Segoe UI, 9pt, style=Italic</value>
</data>
<data name="shortcutsToolStripMenuItemHeading.Size" type="System.Drawing.Size, System.Drawing">
<value>156, 22</value>
</data>
<data name="shortcutsToolStripMenuItemHeading.Text" xml:space="preserve">
<value>Game Shortcuts</value>
</data>
<data name="shortcutToolStripSeparator.Size" type="System.Drawing.Size, System.Drawing">
<value>153, 6</value>
</data>
<data name="shortcutToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>218, 22</value>
</data>
<data name="shortcutToolStripMenuItem.Text" xml:space="preserve">
<value>Run Game Shortcut</value>
</data>
<data name="toolStripSeparator1.Size" type="System.Drawing.Size, System.Drawing">
<value>215, 6</value>
</data>
<data name="exitToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>218, 22</value>
</data>
<data name="exitToolStripMenuItem.Text" xml:space="preserve">
<value>Close HeliosPlus</value>
</data>
<data name="mainContextMenuStrip.Size" type="System.Drawing.Size, System.Drawing">
<value>219, 126</value>
</data>
@ -71100,6 +71025,81 @@
<data name="notifyIcon.Visible" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="toolStripMenuItemHeading.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="toolStripMenuItemHeading.Font" type="System.Drawing.Font, System.Drawing">
<value>Segoe UI, 9pt, style=Italic</value>
</data>
<data name="toolStripMenuItemHeading.Size" type="System.Drawing.Size, System.Drawing">
<value>218, 22</value>
</data>
<data name="toolStripMenuItemHeading.Text" xml:space="preserve">
<value>HeliosPlus</value>
</data>
<data name="toolStripSeparator.Size" type="System.Drawing.Size, System.Drawing">
<value>215, 6</value>
</data>
<data name="openApplicationWindowToolStripMenuItem.Font" type="System.Drawing.Font, System.Drawing">
<value>Segoe UI, 9pt, style=Bold</value>
</data>
<data name="openApplicationWindowToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>218, 22</value>
</data>
<data name="openApplicationWindowToolStripMenuItem.Text" xml:space="preserve">
<value>Open Application Window</value>
</data>
<data name="profileToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>218, 22</value>
</data>
<data name="profileToolStripMenuItem.Text" xml:space="preserve">
<value>Change Display Profile</value>
</data>
<data name="profilesToolStripMenuItemHeading.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="profilesToolStripMenuItemHeading.Font" type="System.Drawing.Font, System.Drawing">
<value>Segoe UI, 9pt, style=Italic</value>
</data>
<data name="profilesToolStripMenuItemHeading.Size" type="System.Drawing.Size, System.Drawing">
<value>155, 22</value>
</data>
<data name="profilesToolStripMenuItemHeading.Text" xml:space="preserve">
<value>Display Profiles</value>
</data>
<data name="profileToolStripSeparator.Size" type="System.Drawing.Size, System.Drawing">
<value>152, 6</value>
</data>
<data name="shortcutToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>218, 22</value>
</data>
<data name="shortcutToolStripMenuItem.Text" xml:space="preserve">
<value>Run Game Shortcut</value>
</data>
<data name="shortcutsToolStripMenuItemHeading.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="shortcutsToolStripMenuItemHeading.Font" type="System.Drawing.Font, System.Drawing">
<value>Segoe UI, 9pt, style=Italic</value>
</data>
<data name="shortcutsToolStripMenuItemHeading.Size" type="System.Drawing.Size, System.Drawing">
<value>156, 22</value>
</data>
<data name="shortcutsToolStripMenuItemHeading.Text" xml:space="preserve">
<value>Game Shortcuts</value>
</data>
<data name="shortcutToolStripSeparator.Size" type="System.Drawing.Size, System.Drawing">
<value>153, 6</value>
</data>
<data name="toolStripSeparator1.Size" type="System.Drawing.Size, System.Drawing">
<value>215, 6</value>
</data>
<data name="exitToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>218, 22</value>
</data>
<data name="exitToolStripMenuItem.Text" xml:space="preserve">
<value>Close HeliosPlus</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>

View File

@ -234,8 +234,10 @@ namespace HeliosPlus.UIForms
if (_selectedShortcut == null)
return;
MainForm mf = (MainForm)this.Owner;
// Run the shortcut
ShortcutRepository.RunShortcut(_selectedShortcut);
ShortcutRepository.RunShortcut(_selectedShortcut, mf.notifyIcon);
}
}
}

View File

@ -0,0 +1,99 @@

namespace HeliosPlus.UIForms
{
partial class WaitingForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WaitingForm));
this.btn_stop_waiting = new System.Windows.Forms.Button();
this.lbl_title = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// btn_stop_waiting
//
this.btn_stop_waiting.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btn_stop_waiting.FlatAppearance.MouseDownBackColor = System.Drawing.Color.IndianRed;
this.btn_stop_waiting.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Brown;
this.btn_stop_waiting.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_stop_waiting.ForeColor = System.Drawing.Color.White;
this.btn_stop_waiting.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.btn_stop_waiting.Location = new System.Drawing.Point(534, 183);
this.btn_stop_waiting.Name = "btn_stop_waiting";
this.btn_stop_waiting.Size = new System.Drawing.Size(99, 23);
this.btn_stop_waiting.TabIndex = 4;
this.btn_stop_waiting.Text = "&Stop Waiting";
this.btn_stop_waiting.UseVisualStyleBackColor = true;
this.btn_stop_waiting.Click += new System.EventHandler(this.btn_stop_waiting_Click);
//
// lbl_title
//
this.lbl_title.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lbl_title.AutoSize = true;
this.lbl_title.Font = new System.Drawing.Font("Microsoft Sans Serif", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lbl_title.ForeColor = System.Drawing.Color.White;
this.lbl_title.Location = new System.Drawing.Point(202, 84);
this.lbl_title.Name = "lbl_title";
this.lbl_title.Size = new System.Drawing.Size(259, 26);
this.lbl_title.TabIndex = 5;
this.lbl_title.Text = "Waiting for game to exit...";
this.lbl_title.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lbl_title.UseWaitCursor = true;
//
// WaitingForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.DimGray;
this.ClientSize = new System.Drawing.Size(645, 218);
this.ControlBox = false;
this.Controls.Add(this.lbl_title);
this.Controls.Add(this.btn_stop_waiting);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "WaitingForm";
this.Opacity = 0.8D;
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Waiting...";
this.TopMost = true;
this.UseWaitCursor = true;
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btn_stop_waiting;
private System.Windows.Forms.Label lbl_title;
}
}

View File

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HeliosPlus.UIForms
{
public partial class WaitingForm : Form
{
public WaitingForm()
{
InitializeComponent();
}
private void btn_stop_waiting_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
}
}

File diff suppressed because it is too large Load Diff