Media Player

cdoverlaw

Centurion
Joined
Oct 11, 2003
Messages
146
how do i use the windows media player 9 component to open media files, what code is required to open the music files,
This is currently my current open code
Code:
Private Sub MenuItem1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
        OpenFileDialog1.ShowDialog() 'display Open dialog box
        If OpenFileDialog1.FileName <> "" Then
            Try
                FileOpen(1, OpenFileDialog1.FileName, OpenMode.Input)
            Catch
                MsgBox("Error opening file.")
            Finally
                FileClose(1) 'close file
            End Try
        End If
    End Sub

Jonathan
 
That doesn't do much. That opens the file for text input, which will do you no good with a media file. I suggest you look at the [api]mciSendString[/api] API for doing things like this. Using the Media Player control - especially in .NET where COM Interop is needed to make it work - adds excessive overhead.
 
i want to use the media player control, i just need to know how to get the files to open in it, i have my reasons why i want to use the media player control, you will see this when i update my open source project with the latest source

jonathan
 
thanks, another module of my project is now complete :D, i need someone to help me to get the program to dock to the side of windows and then i will make the project completly open source
 
Look at the [api]SHAppBarMessage[/api] API. Be warned though, it's fairly to make work well, and I couldn't get it to work right in .NET at all.
 
Back
Top