Im working on a game like risk and for the main menu im having trouble with the music.
the code i use

id = Shell("c:\program files\windows media player\mplayer2.exe /play /close G:\My Music\Various Artists\The No.1 Classical Album\04 Ride of the Valkyries.wma", vbMinimizedNoFocus)

is just to open and play the file. I would like to see if it can be paused in the games options and close the medie player when you exit the game.
ne help would be great. Thanks

Ok so I figured I would write down my own solutions to my own problem just incase anyone would like to know.
you can load a song file with this code

Form1.WindowsMediaPlayer1.URL = "G:\bomb.wav"

and the rest of the functions go as such

Form1.WindowsMediaPlayer1.Controls.play
Form1.WindowsMediaPlayer1.Controls.stop
Form1.WindowsMediaPlayer1.Controls.previous
Form1.WindowsMediaPlayer1.Controls.Next

This was all done by adding the component Windows media player.
So there I have it the answer to my own problem props to me and thank you all for taking the time to read this and know how to get music into your programs.
If you have ne questions message me.
(and you can even get visuals to work its like having your own media player you can customize):cool:

Ok so I figured I would write down my own solutions to my own problem just incase anyone would like to know.
you can load a song file with this code

Form1.WindowsMediaPlayer1.URL = "G:\bomb.wav"

and the rest of the functions go as such

Form1.WindowsMediaPlayer1.Controls.play
Form1.WindowsMediaPlayer1.Controls.stop
Form1.WindowsMediaPlayer1.Controls.previous
Form1.WindowsMediaPlayer1.Controls.Next

This was all done by adding the component Windows media player.
So there I have it the answer to my own problem props to me and thank you all for taking the time to read this and know how to get music into your programs.
If you have ne questions message me.
(and you can even get visuals to work its like having your own media player you can customize):cool:

i'm really new and clueless here so bear with me. how does one add the Windows media player component? i sort of found it in the Components menu but i don't know how to use it.

To add Media Player Component
> Start VBProject
> Click Project -> Components Menu
(a dialog box contains a list of activex components will appear)
> Choose Windows Media Player(put tick mark it will be added to ur toolbox)
> Double Click on the Windows media player icon in the tool box to create an instance
then apply the above codings

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.