From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Close Media Player

Hello everyone, I'am building a simple application that open in automatic every ten minutes an mpeg file with Windows Media Player but I don't know how to close the application automatically at the end of the video file reproduction.
To open the file I used the "Fileman open file.vi" so the application is automatically associated to the type of file.
 
Thanks for the time
 
Massimo Visintin
0 Kudos
Message 1 of 5
(2,518 Views)

How about using the Quit Application VI?

You will have to get the window name in order to close the application, but you will need to that anyway. You can use the other VIs to do this (Get Task List and so on).

Other options would be to use ActiveX, either embedded in the front panel (AX container) or called externally.


___________________
Try to take over the world!
0 Kudos
Message 2 of 5
(2,496 Views)

Yes, my idea is to use the Quit Application.vi but the problem for me is to calculate when the file I select time by time finish its reproduction. In other words I need to know when the AVI or MPEG finish playing

Thanks, Massimo Visintin

0 Kudos
Message 3 of 5
(2,485 Views)

Well, the only ways I can think of are either to connect to the WMP window somehow and extract the information or read the file yourself to see how long it is. I'm sure they're both possible, but I don't know how to do them.

How about my other suggestion of using ActiveX?


___________________
Try to take over the world!
0 Kudos
Message 4 of 5
(2,476 Views)

Thanks for your suggestion. I think I will put the time of file manually, for the moment.

About using ActiveX, I don'like to use it, I prefer to open windows Media Palyer on the second monitor.

 

Thanks.

0 Kudos
Message 5 of 5
(2,470 Views)