Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 160549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:03:17+00:00 2026-05-11T11:03:17+00:00

How do I play the New Mail system sound in C#? This is also

  • 0

How do I play the ‘New Mail’ system sound in C#? This is also called the ‘Notify’ sound.

In Win32, that would be something like

sndPlaySound('Notify', (SND_ALIAS or SND_ASYNC)); 

So how do you do that in .Net? I know that you can do

System.Media.SystemSounds.Asterisk.Play(); 

But there’s a very limited set of five sounds there – not including whatever the the user has set as the new mail sound.

I can find out which .wav file is being played when I get new mail and play that file, but that won’t update when the user’s sound scheme is changed.


What I eventually did:

Instead of playing a system sound, I embedded a wav file into the application as a resource, and played it with System.Media.SoundPlayer

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T11:03:17+00:00Added an answer on May 11, 2026 at 11:03 am

    One option is to just PInvoke directly into the sndSound API. Here is the PInvoke definition for that method

    public partial class NativeMethods {      /// Return Type: BOOL->int     ///pszSound: LPCWSTR->WCHAR*     ///fuSound: UINT->unsigned int     [System.Runtime.InteropServices.DllImportAttribute('winmm.dll', EntryPoint='sndPlaySoundW')]     [return: System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)] public static extern  bool sndPlaySoundW([System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPWStr)] string pszSound, uint fuSound) ;      /// SND_APPLICATION -> 0x0080     public const int SND_APPLICATION = 128;      /// SND_ALIAS_START -> 0     public const int SND_ALIAS_START = 0;      /// SND_RESOURCE -> 0x00040004L     public const int SND_RESOURCE = 262148;      /// SND_FILENAME -> 0x00020000L     public const int SND_FILENAME = 131072;      /// SND_ALIAS_ID -> 0x00110000L     public const int SND_ALIAS_ID = 1114112;      /// SND_NOWAIT -> 0x00002000L     public const int SND_NOWAIT = 8192;      /// SND_NOSTOP -> 0x0010     public const int SND_NOSTOP = 16;      /// SND_MEMORY -> 0x0004     public const int SND_MEMORY = 4;      /// SND_PURGE -> 0x0040     public const int SND_PURGE = 64;      /// SND_ASYNC -> 0x0001     public const int SND_ASYNC = 1;      /// SND_ALIAS -> 0x00010000L     public const int SND_ALIAS = 65536;      /// SND_SYNC -> 0x0000     public const int SND_SYNC = 0;      /// SND_LOOP -> 0x0008     public const int SND_LOOP = 8;      /// SND_NODEFAULT -> 0x0002     public const int SND_NODEFAULT = 2; } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I came across new play module and I would like add it in my
I have play-framework application that uses one module which I've created by play new-module
Just looking for some clarification with the new play button. I notice that when
Good day, After play new todo (new scala project) -> cd todo -> play
I use play2 to create a default scala app: play new test Then: play
After running a new Play-framework 2.0 based project, i failed to clean it -
I want to use japid-0.9* with my new play application. I already installed japid
I´m new to Play and Scala world, so I´m needing some help to figure
I'm new to Play framework. I'm trying to configure MySQL database as a datasource
I'm running play2 on a 512M vps. It can create a new app: play

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.