Hah that explains it. Don't use DllImports for process work. Use the System.Diagnostics namespace. (More importantly, the Process class within that namespace)
Quick little snippet of how to grab the entire list of processes from the current machine.
Code:
public Dictionary<Process, int> ProcessDictionary;
public void GetProcesses()
{
if (ProcessDictionary == null)
{
ProcessDictionary = new Dictionary<Process, int>();
}
Process[] processes = Process.GetProcesses(Environment.MachineName);
foreach (var process in processes)
{
ProcessDictionary.Add(process, process.Id);
}
}