mirror of
https://github.com/DaKerboul/perun.git
synced 2026-08-09 20:15:39 +02:00
Added #4 - only one instance will be allowed to run
This commit is contained in:
13
02_Windows_App/Perun_v1/01_Classes/NativeMethods.cs
Normal file
13
02_Windows_App/Perun_v1/01_Classes/NativeMethods.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
// this class just wraps some Win32 stuff that we're going to use for blocking of multiple instances
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
internal class NativeMethods
|
||||
{
|
||||
public const int HWND_BROADCAST = 0xffff;
|
||||
public static readonly int WM_SHOWME = RegisterWindowMessage("WM_SHOWME");
|
||||
[DllImport("user32")]
|
||||
public static extern bool PostMessage(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam);
|
||||
[DllImport("user32")]
|
||||
public static extern int RegisterWindowMessage(string message);
|
||||
}
|
||||
Reference in New Issue
Block a user