Solved

Using multimedia files in VB 4

Posted on 1998-06-11
5
319 Views
Last Modified: 2010-05-03
Hello everybody,
my goal is to start and stop MIDI-Music in the background and to start and stop AVI and MOV files by clicking a command button (not just by double clicking the video frame).
Who knows what to do in my case ?

Regards, Dr. Timo
0
Comment
Question by:Dr_Timo
  • 3
  • 2
5 Comments
 
LVL 1

Expert Comment

by:cip
Comment Utility
What version of visual basic? Try taking a look at the microsoft multimedia control.
0
 
LVL 1

Author Comment

by:Dr_Timo
Comment Utility
It is Visual Basic Version 4.0. I did not know that it is so difficult to do this. Let's say I want to play MIDI music in the background which can be toggled on/off by Command-Buttons or within the program. And some actions or events should activate a video window to front an just play the movie (multimedia-integration). This must be possible in VB i hope.
0
 
LVL 1

Author Comment

by:Dr_Timo
Comment Utility
It is Visual Basic Version 4.0. I did not know that it is so difficult to do this. Let's say I want to play MIDI music in the background which can be toggled on/off by Command-Buttons or within the program. And some actions or events should activate a video window to front an just play the movie (multimedia-integration). This must be possible in VB I hope.
0
 
LVL 1

Accepted Solution

by:
cip earned 100 total points
Comment Utility
Dr_Timo,

Sure it is possibile.

Open VB, then from the menu "Tools", select "Custom controls".
From the available controls, select "Microsoft Multimedia control".
Then, draw a multimedia control on the form, together with three command buttons, name them cmdPlay, cmdStop and cmdRewind.
Paste this code in the Form_Load event and in the click events of the three buttons:

Private Sub Form_Load()
    ' Load a multimedia file into Microsoft
    ' multimedia control
    MMControl1.filename = "song.mid"
    ' Open the media, preparing to play
    MMControl1.Command = "Open"
End Sub

Private Sub cmdPlay_Click()
    ' Play media
    MMControl1.Command = "Play"
End Sub

Private Sub cmdStop_Click()
    ' Stop the media
    MMControl1.Command = "Stop"
End Sub

Private Sub cmdRewind_Click()
    ' First stop the media
    MMControl1.Command = "Stop"
   
    ' Then seek to position 0
    MMControl1.To = 0
    MMControl1.Command = "Seek"
End Sub

You can do exactly the same for a video file, simply substitute "song.mid" with the name of the video you want to play, or just use two different multimedia controls.

Cip.
0
 
LVL 1

Author Comment

by:Dr_Timo
Comment Utility
Thank you very much, Cip! That does help me a lot !
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now