|
-
Mar 26th, 2002, 03:59 PM
#1
Thread Starter
Addicted Member
sound events
i know how to play sounds using the api. BUT!! how do i call a sound event, as in the ones that are stored in the sound scheme in the sounds control panel?
Cheers
Craig
-
Mar 26th, 2002, 04:11 PM
#2
-= B u g S l a y e r =-
maybe u have to do it the other way arround... get the name of the file connected to an event, and then play it... just thinking out loud
-
Mar 26th, 2002, 06:10 PM
#3
Well you can get the filepath from the registry, that is the way I did....but then I learned that you can do it straight from the API.
The key is using the SND_ALIAS const.
VB Code:
Private Const SND_ALIAS = &H10000
Private Const SND_ASYNC = &H1
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
'then use it like this
PlaySound "SystemStart", ByVal 0&, SND_ALIAS Or SND_ASYNC
The thing is you have to use the name of the key in the registry which is not always the name that shows up in the control panel.
Look here:
http://web.missouri.edu/~finaidtk/ezplay.htm
or in the registry here:
HKEY_CURRENT_USR\AppEvents\Schemes\Apps
Last edited by Edneeis; Mar 27th, 2002 at 01:24 PM.
-
Mar 26th, 2002, 06:24 PM
#4
Slightly different than you asked, but you can associate sounds to your application through the control panel and they will be handled automatically by Windows.
(Like when your program crashes, or when question windows are popped up).
I can tell you how if you are interested.
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
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
|
Click Here to Expand Forum to Full Width
|