-
How to insert movies/sounds in a Form
[Originally posted by rcoltrane]
I need to insert a movie file in one form with the mpeg, avi or flc extensions. Is there any way to do that? How can I play wav sounds on form/load for example?
-
Re:How to insert movies/sounds in a Form
[Originally posted by Andrea Batina]
To play the movies you need to load Microsoft Media Player controls from Tools\Components.
Andrea Batina
-
Re:How to insert movies/sounds in a Form
[Originally posted by neophile]
Windows Media Player should be listed in your components.
Also, to just play a WAV file quickly, just toss this code into a module...
Option Explicit
Private Const SND_APPLICATION = &H80ÿ ÿ ÿ ÿ 'ÿ look for application specific association
Private Const SND_ALIAS = &H10000ÿ ÿ 'ÿ name is a WIN.INI [sounds] entry
Private Const SND_ALIAS_ID = &H110000ÿ ÿ 'ÿ name is a WIN.INI [sounds] entry identifier
Private Const SND_ASYNC = &H1ÿ ÿ ÿ ÿ 'ÿ play asynchronously
Private Const SND_FILENAME = &H20000ÿ ÿ 'ÿ name is a file name
Private Const SND_LOOP = &H8ÿ ÿ ÿ ÿ 'ÿ loop the sound until next sndPlaySound
Private Const SND_MEMORY = &H4ÿ ÿ ÿ ÿ 'ÿ lpszSoundName points to a memory file
Private Const SND_NODEFAULT = &H2ÿ ÿ ÿ ÿ 'ÿ silence not default, if sound not found
Private Const SND_NOSTOP = &H10ÿ ÿ ÿ ÿ 'ÿ don't stop any currently playing sound
Private Const SND_NOWAIT = &H2000ÿ ÿ ÿ 'ÿ don't wait if the driver is busy
Private Const SND_PURGE = &H40ÿ ÿ ÿ ÿ ÿ ÿ ÿ 'ÿ purge non-static events for task
Private Const SND_RESOURCE = &H40004ÿ ÿ 'ÿ name is a resource name or atom
Private Const SND_SYNC = &H0ÿ ÿ ÿ ÿ 'ÿ play synchronously (default)
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Public Sub PlayWAV(ByVal WAVFile As String, Optional ByVal Wait As Boolean)
ÿ ÿ If Wait Then
ÿ ÿ ÿ ÿ PlaySound WAVFile, ByVal 0&, SND_FILENAME
ÿ ÿ Else
ÿ ÿ ÿ ÿ PlaySound WAVFile, ByVal 0&, SND_FILENAME Or SND_ASYNC
ÿ ÿ End If
End Sub
...then you can just go...
Private Sub Form_Load()
ÿ ÿ PlayWAV "C:\SomeFolder\somesound.wav"
End Sub
-
Re:Re:How to insert movies/sounds in a Form
[Originally posted by rcoltrane]
Thanks for helping. It works fine.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks