Windows Media Player cannot open MP3 files
-
Hi all, I'm currently working on an application that opens media files with respect to their file extensions. Images are opened with Microsoft image viewer, video is opened with VLC and mp3 is supposed to be played with windows media player/VLC. So far opening images works fine but when I try to open video or music files i get the error that the opened application is unable to play the file.I'm positive that It has something to do with the spaces on the file location e.g. c:\Program Files\Windows Media Player\something.mp3. Question is how do I make it that the location doesn't incur any spaces or is there another way to open the files in their respective application aside from what I've been doing. I'm using vb6 by the way. Below are the codes I use for my task: Images
Shell "rundll32.exe C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen " & txtscreenshot.Text & "", vbMaximizedFocus
Video
Shell ("C:\Program Files\VideoLAN\VLC\vlc.exe " & txtscreenshot.Text & ""), vbNormalFocus
Music
Shell "C:\Program Files\Windows Media Player\wmplayer.exe " & txtscreenshot.Text & "", vbNormalFocus
Many thanks for all your replies! :-D
-
Hi all, I'm currently working on an application that opens media files with respect to their file extensions. Images are opened with Microsoft image viewer, video is opened with VLC and mp3 is supposed to be played with windows media player/VLC. So far opening images works fine but when I try to open video or music files i get the error that the opened application is unable to play the file.I'm positive that It has something to do with the spaces on the file location e.g. c:\Program Files\Windows Media Player\something.mp3. Question is how do I make it that the location doesn't incur any spaces or is there another way to open the files in their respective application aside from what I've been doing. I'm using vb6 by the way. Below are the codes I use for my task: Images
Shell "rundll32.exe C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen " & txtscreenshot.Text & "", vbMaximizedFocus
Video
Shell ("C:\Program Files\VideoLAN\VLC\vlc.exe " & txtscreenshot.Text & ""), vbNormalFocus
Music
Shell "C:\Program Files\Windows Media Player\wmplayer.exe " & txtscreenshot.Text & "", vbNormalFocus
Many thanks for all your replies! :-D
-
Hi! Thanks for the reply :)
Eddy Vluggen wrote:
Notice the extra quotes around "txtscreenshot.Text" Smile
Yeah I've tried removing that quote but it still doesn't open. So in static "txtscreenshot.Text" generates path names like "C:\Documents and Settings\Computer1\Desktop\New\something.mp3". Shell command recognizes "C:\Documents" as 1 file "and" as another and so on. How can I make it recognize the path name as it is?
Eddy Vluggen wrote:
..why? VB.NET is a free download, check out Visual Basic.NET Express Smile
I know...that's a great deal of my problem :laugh: ;P
Aim small, miss small
-
Hi! Thanks for the reply :)
Eddy Vluggen wrote:
Notice the extra quotes around "txtscreenshot.Text" Smile
Yeah I've tried removing that quote but it still doesn't open. So in static "txtscreenshot.Text" generates path names like "C:\Documents and Settings\Computer1\Desktop\New\something.mp3". Shell command recognizes "C:\Documents" as 1 file "and" as another and so on. How can I make it recognize the path name as it is?
Eddy Vluggen wrote:
..why? VB.NET is a free download, check out Visual Basic.NET Express Smile
I know...that's a great deal of my problem :laugh: ;P
Aim small, miss small
tatchung wrote:
I know...that's a great deal of my problem
What does this mean ? VB6 was always crap, and it's been unsupported for a long time. In VB.NET, you drag a WMP control onto your form and tell it what to play, easy.
Christian Graus Driven to the arms of OSX by Vista.
-
Hi! Thanks for the reply :)
Eddy Vluggen wrote:
Notice the extra quotes around "txtscreenshot.Text" Smile
Yeah I've tried removing that quote but it still doesn't open. So in static "txtscreenshot.Text" generates path names like "C:\Documents and Settings\Computer1\Desktop\New\something.mp3". Shell command recognizes "C:\Documents" as 1 file "and" as another and so on. How can I make it recognize the path name as it is?
Eddy Vluggen wrote:
..why? VB.NET is a free download, check out Visual Basic.NET Express Smile
I know...that's a great deal of my problem :laugh: ;P
Aim small, miss small
Perhaps this one?
Shell "C:\Program Files\Windows Media Player\wmplayer.exe " & Chr(34) & txtscreenshot.Text & Chr34, vbNormalFocus
The above code will put quotation-marks inside the command. That way Windows knows that the path doesn't end after the first space that it sees. Enjoy[^] :)
I are troll :)
-
tatchung wrote:
I know...that's a great deal of my problem
What does this mean ? VB6 was always crap, and it's been unsupported for a long time. In VB.NET, you drag a WMP control onto your form and tell it what to play, easy.
Christian Graus Driven to the arms of OSX by Vista.
-
Perhaps this one?
Shell "C:\Program Files\Windows Media Player\wmplayer.exe " & Chr(34) & txtscreenshot.Text & Chr34, vbNormalFocus
The above code will put quotation-marks inside the command. That way Windows knows that the path doesn't end after the first space that it sees. Enjoy[^] :)
I are troll :)