All Forums
 Microsoft Windows CE
 CE Audio and Multimedia
 GraphicsMaster, CE.Net:Dont hear anything....
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

dorgant

46 Posts

Posted - 07 Aug 2003 :  13:05:36  Show Profile  Email Poster
I looked at the code in the sys_snds.cpp sample and on the net. I got the following for c#. I run it and don't hear anything. Any suggestions appreciated. PS - I don't have a hearing problem ;)

public enum BeepType
{
SimpleBeep = -1,
IconAsterisk = 0x00000040,
IconExclamation = 0x00000030,
IconHand = 0x00000010,
IconQuestion = 0x00000020,
Ok = 0x00000000,
}
[DllImport("coredll.dll")]
static extern int MessageBeep(UInt32 beepType);

for(int i = 0; i < 100; ++i)
// BeepType.IconExclamation is also silent
MessageBeep((uint)BeepType.Ok);

ctacke

877 Posts

Posted - 11 Aug 2003 :  13:26:36  Show Profile  Email Poster
First, I see from some of your other posts you didn't have speakers hooked up, so checking that will be step 1.

Once you've got speakers hooked up, you can play a "beep" either through P/Invoking MessageBeep or, for more control, PlaySound. The declarations for both are as follows:


public enum SoundFlags : uint
{
Alias = 0x00010000,
Filename = 0x00020000,
Resource = 0x00040004,
Synchronous = 0x00000000,
ASynchronous = 0x00000001,
NoDefault = 0x00000002,
Memory = 0x00000004,
Loop = 0x00000008,
NoStop = 0x00000010,
NoWait = 0x00002000
}


public enum BeepType : uint
{
Default = 0xFFFFFFFF,
OK = 0x00000000,
Hand = 0x00000010,
Question = 0x00000020,
Exclamation = 0x00000030,
Asterisk = 0x00000040
}


[ DllImport("coredll.dll", EntryPoint="PlaySoundW", SetLastError=true) ]
public extern static int PlaySound(String lpszName, IntPtr hModule, SoundFlags dwFlags);


[ DllImport("coredll.dll", EntryPoint="MessageBeep", SetLastError=true) ]
public extern static int MessageBeep(BeepType uType);


Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.02 seconds. Snitz Forums 2000