1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2024-11-14 17:42:47 +01:00
TweetDuck/Migration/Helpers/ProgramProcessSearch.cs

16 lines
445 B
C#

using System;
using System.Diagnostics;
using System.Linq;
namespace TweetDck.Migration.Helpers{
static class ProgramProcessSearch{
public static Process FindProcessWithWindowByName(string name){
try{
return Process.GetProcessesByName(name).FirstOrDefault(process => process.MainWindowHandle != IntPtr.Zero);
}catch(Exception){
return null;
}
}
}
}