detecting media player
-
Hello All, In my vb.net application i am playing audio files using window media player. Sometimes application fails , if window media player is not installed on the user's machine. So, how it can be detect whether media plyer is available or not befor plying. Does any API exists using which we can retrieve data from system registry. Anyone who knows the answer, Please tell Any help will be highly appreciated. Thanks in advance.
-
Hello All, In my vb.net application i am playing audio files using window media player. Sometimes application fails , if window media player is not installed on the user's machine. So, how it can be detect whether media plyer is available or not befor plying. Does any API exists using which we can retrieve data from system registry. Anyone who knows the answer, Please tell Any help will be highly appreciated. Thanks in advance.
If you want to detect whether media player is installed, you need to check whether or not the wmplayer.exe file exists in "[BOOTDRIVE]:\Program Files\Windows Media Player\wmplayer.exe". To do that, you need to check it when your main form loads. Example below: Imports System.IO Dim ProgramsPath As String = My.Computer.FileSystem.SpecialDirectories.ProgramFiles If File.Exists(ProgramsPath & "\Windows Media Player\wmplayer.exe") = False Then
// Exit the application. or, whatever you want to do.
Application.Exit()
End If That should do it. Good luck with your program! :)