Link to home
Start Free TrialLog in
Avatar of thurst
thurst

asked on

Playing sound holding up application

I have a problem with my about screen.  I have rigged it so it currently plays a sound when it loads....Which is fine except that you have to wait until the sound finishes before accessing any of the buttons on that screen.

I want it to work as a normal about screen would...where it plays the sound but you can still access the screen functionality while its playing.

Suggestions?


-----

Private Sub Form_Load()

Dim Sound As Long

frmAbout.Show
Me.Caption = "About " & App.Title
lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision
lblTitle.Caption = App.Title

DoEvents ' Passing time back to CPU..

'Plays a tune when the about screen is opened
Sound = sndPlaySound("The Microsoft Sound.wav", SND_SYNC Or SND_NODEFAULT)

End Sub
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Try it with a api-call

Private Declare Function dcPlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long

Private Const SND_SYNC = &H0
Private Const SND_ASYNC = &H1
Private Const SND_NODEFAULT = &H2
Private Const SND_LOOP = &H8
Private Const SND_NOSTOP = &H10
Private Const SND_USUAL = SND_ASYNC And SND_NODEFAULT

'Sample call
Call dcPlaySound("C:\windows\media\The Microsoft Sound.wav", 0, SND_USUAL)
ASKER CERTIFIED SOLUTION
Avatar of flopperman
flopperman

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of thurst
thurst

ASKER

Cheers.  You don't know how much that use to BUG me. (no pun intended).