Added #4 - only one instance will be allowed to run

This commit is contained in:
Szymon Porwolik
2019-02-28 23:06:38 +01:00
committed by simpo
parent 69f995bd6d
commit f383f3c056
4 changed files with 64 additions and 12 deletions

View File

@@ -544,5 +544,27 @@ namespace Perun_v1
}
}
}
protected override void WndProc(ref Message m)
{
if (m.Msg == NativeMethods.WM_SHOWME)
{
ShowMe();
}
base.WndProc(ref m);
}
private void ShowMe()
{
if (WindowState == FormWindowState.Minimized)
{
WindowState = FormWindowState.Normal;
}
// get our current "TopMost" value (ours will always be false though)
bool top = TopMost;
// make our form jump to the top of everything
TopMost = true;
// set it back to whatever it was
TopMost = top;
}
}
}