Sounds - Playing System Event Sounds (asterisk, critical stop, question, etc) 
Author Message
 Sounds - Playing System Event Sounds (asterisk, critical stop, question, etc)

Does anyone know if there is an equivalent VB.NET function or method for playing a system event sounds (the ones you see if you go into the "Sounds and Multimedia" control panel: Asterisk, Close program, Critical Stop, Default Beep, Exclamation, Exit Windows, Minimize, Maximize, Restore Down, Question, Program error, etc etc)

Is there an alternative to the PlaySound API?

From http://www.*-*-*.com/
http://www.*-*-*.com/

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

retval = PlaySound("SystemStart", 0, SND_ALIAS Or SND_SYNC)

  I looked in System.IO, System.Resources, and others, but I couldn't find anything.  I also searched through MSDN and on Google but came up with nothing.
  If the API is the only choice, does anyone know how to alter this API declaration to work in VB.NET ?



Sun, 07 Nov 2004 05:26:39 GMT  
 Sounds - Playing System Event Sounds (asterisk, critical stop, question, etc)

Hi,

Unfortunately, there are no alternatives to this API in the .NET framework classes. With this API, I just converted the Long parameters and return value to Integer, and it works fine. A good choice would be to put this declaration in some class, with other API functions you may have.

You can import the function too, with the DllImport attribute. You have some of declarations of the function in that way at this forums (search "play sounds" in microsoft.public.dotnet).

Hope it helps!

Mariano Birnios


  Does anyone know if there is an equivalent VB.NET function or method for playing a system event sounds (the ones you see if you go into the "Sounds and Multimedia" control panel: Asterisk, Close program, Critical Stop, Default Beep, Exclamation, Exit Windows, Minimize, Maximize, Restore Down, Question, Program error, etc etc)

  Is there an alternative to the PlaySound API?

  From http://www.vbapi.com
  http://216.26.161.91/vbapi/ref/p/playsound.html

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

  retval = PlaySound("SystemStart", 0, SND_ALIAS Or SND_SYNC)

    I looked in System.IO, System.Resources, and others, but I couldn't find anything.  I also searched through MSDN and on Google but came up with nothing.
    If the API is the only choice, does anyone know how to alter this API declaration to work in VB.NET ?



Sun, 07 Nov 2004 03:21:35 GMT  
 Sounds - Playing System Event Sounds (asterisk, critical stop, question, etc)
I couldn't find a newsgroup microsoft.public.dotnet, but I searched in
microsoft.public.dotnet.general and microsoft.public.dotnet.framework with
no success.  Which particular newsgroup were you referring to?

I did get the API to work as you suggested and found a list of possible
sounds here:
I'm not sure if these are all the possible values or if it is just a subset
though.

http://www.tek-tips.com/gfaqs.cfm/lev2/4/lev3/32/spid/222/sfid/850

SystemAsterisk            - Asterisk
Default                        - Default Beep
EmptyRecycleBin        - when recycle bin is emptied
SystemExclamation    - when windows shows a warning
SystemExit        - when Windows shuts down
Maximize          - when a program is maximized
MenuCommand       - when a menu item is clicked on
MenuPopup         - when a (sub)menu pops up
Minimize          - when a program is minimized to taskbar
MailBeep          - when email is received
Open              - when a program is opened
SystemHand        - when a critical stop occurs
AppGPFault        - when a program causes an error
SystemQuestion    - when a system question occurs
RestoreDown       - when a program is restored to normal size
RestoreUp         - when a program is restored to normal size from taskbar
SystemStart       - when Windows starts up
Close             - when program is closed
Ringout           - when (fax) call is made outbound and the line is ringing
RingIn            - incoming (fax) call


Hi,

Unfortunately, there are no alternatives to this API in the .NET framework
classes. With this API, I just converted the Long parameters and return
value to Integer, and it works fine. A good choice would be to put this
declaration in some class, with other API functions you may have.

You can import the function too, with the DllImport attribute. You have some
of declarations of the function in that way at this forums (search "play
sounds" in microsoft.public.dotnet).

Hope it helps!

Mariano Birnios



Does anyone know if there is an equivalent VB.NET function or method for
playing a system event sounds (the ones you see if you go into the "Sounds
and Multimedia" control panel: Asterisk, Close program, Critical Stop,
Default Beep, Exclamation, Exit Windows, Minimize, Maximize, Restore Down,
Question, Program error, etc etc)

Is there an alternative to the PlaySound API?

From http://www.vbapi.com
http://216.26.161.91/vbapi/ref/p/playsound.html

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

retval = PlaySound("SystemStart", 0, SND_ALIAS Or SND_SYNC)

  I looked in System.IO, System.Resources, and others, but I couldn't find
anything.  I also searched through MSDN and on Google but came up with
nothing.
  If the API is the only choice, does anyone know how to alter this API
declaration to work in VB.NET ?



Sun, 07 Nov 2004 07:45:18 GMT  
 Sounds - Playing System Event Sounds (asterisk, critical stop, question, etc)
Oops, you have right, there's no such newsgroup. What I wanted to mean is
that you can search trought all groups "inside" microsoft.public.dotnet, at
the search page. I have done the search, you can use the following link to
see the results:

http://search.communities.microsoft.com/newsgroups/searchmessagelist....
mystring=Message+body+is+a+required+field&dummystring2=Please+remove+any+pun
ctuation+symbols+from+the+search+field&dummystring3=Search+In+Progress......
Please+wait_%21&currentcontext=search&curyear=2002&newsgroup=microsoft.publi
c.dotnet.languages.vb&numOfDaysCheck=14&ICP=msdn&sLCID=US&searchnewsgrouplev
el=microsoft.public.dotnet&from=&subject=Play+Sounds&message=&lowday=7&lowmo
nth=5&lowyear=2000&highday=21&highmonth=5&highyear=2002

You have a lot of discussions on this topic there.

I'm not really sure if that's the complete list of system sounds... hope you
can find it!

Cheers

Mariano Birnios



Quote:
> I couldn't find a newsgroup microsoft.public.dotnet, but I searched in
> microsoft.public.dotnet.general and microsoft.public.dotnet.framework with
> no success.  Which particular newsgroup were you referring to?

> I did get the API to work as you suggested and found a list of possible
> sounds here:
> I'm not sure if these are all the possible values or if it is just a
subset
> though.

> http://www.tek-tips.com/gfaqs.cfm/lev2/4/lev3/32/spid/222/sfid/850

> SystemAsterisk            - Asterisk
> Default                        - Default Beep
> EmptyRecycleBin        - when recycle bin is emptied
> SystemExclamation    - when windows shows a warning
> SystemExit        - when Windows shuts down
> Maximize          - when a program is maximized
> MenuCommand       - when a menu item is clicked on
> MenuPopup         - when a (sub)menu pops up
> Minimize          - when a program is minimized to taskbar
> MailBeep          - when email is received
> Open              - when a program is opened
> SystemHand        - when a critical stop occurs
> AppGPFault        - when a program causes an error
> SystemQuestion    - when a system question occurs
> RestoreDown       - when a program is restored to normal size
> RestoreUp         - when a program is restored to normal size from taskbar
> SystemStart       - when Windows starts up
> Close             - when program is closed
> Ringout           - when (fax) call is made outbound and the line is
ringing
> RingIn            - incoming (fax) call



> Hi,

> Unfortunately, there are no alternatives to this API in the .NET framework
> classes. With this API, I just converted the Long parameters and return
> value to Integer, and it works fine. A good choice would be to put this
> declaration in some class, with other API functions you may have.

> You can import the function too, with the DllImport attribute. You have
some
> of declarations of the function in that way at this forums (search "play
> sounds" in microsoft.public.dotnet).

> Hope it helps!

> Mariano Birnios



> Does anyone know if there is an equivalent VB.NET function or method for
> playing a system event sounds (the ones you see if you go into the "Sounds
> and Multimedia" control panel: Asterisk, Close program, Critical Stop,
> Default Beep, Exclamation, Exit Windows, Minimize, Maximize, Restore Down,
> Question, Program error, etc etc)

> Is there an alternative to the PlaySound API?

> From http://www.vbapi.com
> http://216.26.161.91/vbapi/ref/p/playsound.html

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

> retval = PlaySound("SystemStart", 0, SND_ALIAS Or SND_SYNC)

>   I looked in System.IO, System.Resources, and others, but I couldn't find
> anything.  I also searched through MSDN and on Google but came up with
> nothing.
>   If the API is the only choice, does anyone know how to alter this API
> declaration to work in VB.NET ?



Sun, 07 Nov 2004 05:01:39 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Playing sounds even if other applications are playing sounds

2. play sound after sound.

3. Urgent, How to: Play sound using sound card?

4. Urgent, How to: Play sound using sound card?

5. Stopping a sound playing in VB app

6. Stop Playing Sound

7. Having the Sound Events sound file located in a DLL

8. Play system sounds

9. Playing Sound file on event??!!

10. Play WAV sound on event??

11. Playing a WAV sound on a click event.

12. playing sound on events...

 

 
Powered by phpBB® Forum Software