1

I am trying to launch Windows Media Player through Process.Start. I am able to start the wmplayer.exe and with filename as argument its playing the file. But it is playing in Media Player Window. I need to show the media instead on my own form. Is it possible to do it? MPlayer, an opensource media player has an option called "-wid" which will tell Mplayer to show output inside our form. I am trying to do something same with WMP.

I know WMP has activex control and we can embed it on a winforms to play any video. But I have encountered some problems with this way. So thinking to launch WMP as a process and play the media on my forms.

user281693
  • 615
  • 2
  • 8
  • 20
  • Trying to run WMP as a separate process and get it to display in your form is simply not going to fly. Don't go there. Go for an embedded approach. – David Heffernan Sep 26 '11 at 18:54
  • 1
    possible duplicate of [Embedding Video in a WinForms app](http://stackoverflow.com/questions/332117/embedding-video-in-a-winforms-app) – David Heffernan Sep 26 '11 at 18:55
  • @DavidHeffernan Is it not possible to do or not advised to do? Any reason why its not a good approach? – user281693 Sep 26 '11 at 18:58
  • @DavidHeffernan Yeah I know how to embed a WMP in winform through activex control. Infact I have it working. But want to try this approach. – user281693 Sep 26 '11 at 19:00
  • 1
    Getting a separate process to display inside your window is a nightmare. You probably won't get it to work. How do you control the media player? – David Heffernan Sep 26 '11 at 19:02
  • @DavidHeffernan Well I only need play and stop options. So for stop I will just kill the process. – user281693 Sep 26 '11 at 19:04
  • Well, good luck. Can't imagine why you prefer this approach, but it's your choice. – David Heffernan Sep 26 '11 at 19:05
  • As I said I have embedded approach working and just wanted to try this one. I got this idea from MPlayer which has -wid command line option by which we can give the handle of the window on which we want the Mplayer to display the media. When I play my media on WMP it plays fine without crashing. But using activex control my app crashes like every two days. (some unhandled exception in quartz.dll) That is why I wanted to try launching exe through Process.Start. But now I do not know how to display the media in my form or if it is even possible. Tell me how to do it and I will test. – user281693 Sep 26 '11 at 19:12

0 Answers0