AVI Using API Function Calls

Can anyone tell me how to display an  AVI video in a VB 5 program using API functions, also
l want the video to run full screen “No surrounding borders or  MAX\MIN buttons”  and to
then shut automatically.

regards Kevin
Who is Participating?
sharmonConnect With a Mentor Commented:
I believe this might be what you are looking for.  Hopefully you find it is.  Also, it will play any type of video the system has mci support for such as Mpeg, etc...I have only given you the basics, you will need to add such things as what happens when the user hits escape and so on...

'----------Begin Code CUT HERE-----------------------
Private Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As _
String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long

Private Sub PlayAVI(aFilename As String)
Dim CmdStr$
Dim ReturnVal&
CmdStr$ = "play " & aFilename & " fullscreen"
ReturnVal& = mciSendString(CmdStr$, 0&, 0, 0&)
End Sub

Private Sub Form_Load()
' Just modify the path and filename as needed.
PlayAVI "e:\video\president.avi"
End Sub
'----------End Code CUT HERE-----------------------
1 Change the form's border style to 0 - none
2 Change the form's window state to 2 - maximized
3 Stick an OLE on your form
4 Point it to the correct AVI file
5 Paste the following code:

Option Explicit

Private Sub Form_Load()

Me.OLE1.Action = 7

End Sub

Private Sub OLE1_Updated(Code As Integer)


End Sub

608Author Commented:
Thanks for you input, but l really want to achieve this using  API

regards Kevin.
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

608Author Commented:
l have an Safety Induction Program l have written at my
workplace, it contains video and audio files, it takes
new employees through a series of topics before they are
introduced to the work environment, the audio files are played using API functions.

So l wanted to know if it was possible to achieve the same
for Video.

regards Kevin.
I see. It probably is, but alas I'm not an API expert. I hope someone else will be able to help you out...

Good luck!
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.

This is the Community Support link, if help is needed, along with the link to All Topics since many new ones were recently added.

Moderator @ Experts Exchange
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.