Question
How to Close another Process from c#
I need to close another Process (Windows Media Encoder) from a C# Application ,and so far i can do it with:
Process.GetProcessesByName("wmenc.exe")[0].CloseMainWindow();
But if the Media Encoder Application is Streaming or Recording it shows a Dialog on exit:
"Are you sure you want to stop encoding?"
So is there a way to answer or click Yes button from Code?
[Edit]
Many users are answering with Process.kill()
,but that is not an Option ,because Process.Kill();
will Terminate Windows Media Encoder immediately ,and Windows Media Encoder will not Finalize the File which is Writing ,which forces me to Reindex the Video File .So no i cannot use Process.Kill();
21 40024
21