Hello, I need to kill a process before update it in C#, I can't use dzHW.dll coz I want get a one EXE file without dll file...
I searched for GetWindowThreadProcessId(IntPtr hwnd) and GetProcessById(Int32 id) but how get the process id? (PID) from an exe filename?
And how check if it's running? I tried with FindWindow but I need also the Windows Handle and I don't know the Window handle...
Assuming you are on the desktop you can get an array of Process objects representing running processes with Process.GetProcesses or Process.GetProcessesByName for a specific exe. Once you have a Process object for the exe you can have your wicked way with it.