Solved

Using multimedia files in VB 4

Posted on 1998-06-11
5
352 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 1

Expert Comment

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

Author Comment

by:Dr_Timo
ID: 1463082
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
ID: 1463083
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
ID: 1463084
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
ID: 1463085
Thank you very much, Cip! That does help me a lot !
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month8 days, 3 hours left to enroll

617 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