mirror of
https://github.com/DaKerboul/perun.git
synced 2026-08-09 18:25:40 +02:00
Added #4 - only one instance will be allowed to run
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user