GetAllProccess Function Return All Runing Proccesses In Windows. I want to get current proccess name which extension is ".avi", ".mkv", ".mpg", ".mp4", ".wmv"
e.g. if I play any video file in windows media player it return (wmplayer.exe) or if I play any video file in KM PLAYER it returns(kmplayer.exe)
Thanks
here is my code this code working very slow
reference http://vmccontroller.codeplex.com/SourceControl/changeset/view/47386#195318
string filename; Process[] procs = Process.GetProcesses() ; foreach (Process prc in procs) {
if (procs.Length > 0)
{
int id = prc.Id;
IEnumerator<FileSystemInfo> fie = DetectOpenFiles.GetOpenFilesEnumerator(id);
while (fie.MoveNext())
{
if (fie.Current.Extension.ToLower(CultureInfo.InvariantCulture) == ".mp3")
{
filename = fie.Current.FullName;
break; // TODO: might not be correct. Was : Exit While
}
}
}
}