CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2000
    Posts
    156

    Question How to invoke message beep in C#?

    Either in calling C# APIs or invoking Win32 API - I am new for C#.


    Thanks,

    Ming

  2. #2
    Join Date
    Jun 2002
    Location
    Bathurst, NB Canada
    Posts
    21
    You can call the API in C# like this:

    using System.Runtime.InteropServices;

    class ...
    {
    [DllImport("kernel32.dll")]
    public static extern bool Beep(int Frequency, int Duration);

    public SomeFunctionToBeep ...
    {
    Beep(250, 250);
    }

    }

    Enjoy!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured