Search code examples
c#compact-frameworkaudio

beep in WinCE , it possible ?


is it possible to make beep in WinCE ?

i try and i get an error


Solution

  • The .net framework methods for beeing are not available in the CF version of the framework. The best way to get a beep sound is to PInvoke into the MessageBeep function. The PInvoke signature for this method is pretty straight forward

    [DllImport("CoreDll.dll")]
    public static extern void MessageBeep(int code);
    
    public static void MessageBeep() {
      MessageBeep(-1);  // Default beep code is -1
    }
    

    This blog post has an excellent more thorough example: http://blog.digitforge.com/?p=4 (on archive.org)