Answer the question
In order to leave comments, you need to log in
How to specify path to c# dll?
Looking for a process
Process[] processesByName = Process.GetProcessesByName("somename");
Process selectedProcess = null;
foreach (Process t in processesByName.Where(t => t.Modules.Cast<ProcessModule>().Any(each => each.FileName.EndsWith("somedll.dll"))))
{
selectedProcess = t;
}
//Если нашли
if (selectedProcess != null)
{
IntPtr processHandle = WinApis.OpenProcess(1040, false, selectedProcess.Id);
[DllImport("kernel32.dll")]
public static extern IntPtr OpenProcess(uint processAcces, bool bInheritHandle, int processId);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question