I am trying to compile this source
class Program
{
static void Main(string[] args)
{
String MutexName = "TibiaPlayerMutex";
String ProcessName = "tibia";
int i = 0;
do
{
try
{
Process process = Process.GetProcessesByName(ProcessName)[0];
var handles = Win32Processes.GetHandles(process, "Mutant", "\\Sessions\\1\\BaseNamedObjects\\" + MutexName);
if (handles.Count == 0) throw new System.ArgumentException("NoMutex", "original");
foreach (var handle in handles)
{
IntPtr ipHandle = IntPtr.Zero;
if (!Win32API.DuplicateHandle(Process.GetProcessById(handle.ProcessID).Handle, handle.Handle, Win32API.GetCurrentProcess(), out ipHandle, 0, false, Win32API.DUPLICATE_CLOSE_SOURCE))
Console.WriteLine("DuplicateHandle() failed, error = {0}", Marshal.GetLastWin32Error());
Console.WriteLine("Mutex was killed");
}
}
catch { }
} while (i == 0);
}
}
Iam getting the following
The name 'Win32Processes' does not exist in the current context d:\users\yorick grijseels\documents\visual studio 2013\Projects\WindowsFormsApplication4\WindowsFormsApplication4\Program.cs 32 35 WindowsFormsApplication4
i googled a bit but i cant find a way to fix this am i missing something?