How to make phone ringing ? RRS feed

  • Question

  • Hi all, I need in some events to make the phone to start ringing

    (as when incoming call occurs)... How can I do that ?

    Thursday, April 22, 2010 6:02 PM


All replies

  • Do you want to simulate an incoming call? On the emulator you can use the Cellular Emulator to do that. See here .

    Or if you just want to play a sound on the device, you can use the Sound API, sndPlaySound() . A bit more details about the problem would be nice.



    Friday, April 23, 2010 2:16 AM
  • Hi, Thanks for answer...

    I need in some event to make the same ring sequence as in incomming call... sndPlaySound really works fine... BUT:

    can I access phone configuration and to make what is for current configuration ?

    So example if the phone is muted and vibration is turned on, when my event occur the phone

    to start vibrating ? Or to play user selected ringtone ? 

    I can get preffered ringtone via RingTone0 registry property but I'm looking for a fuction for example PhoneRing(...),

    that do it automatically play sound and vibrate depending of current mode ?

    Btw, how can I play wma files in WM6.x



    Saturday, April 24, 2010 5:44 PM
  • Ok, from what I understand, you are looking for an api like, say PhoneRing(), which would either play the current Ring Tone out loud, or if the phone is set to Silent mode, it would vibrate the device and so on. From what I know I don't think such an API is available. I guess you will have to do it yourself, i.e, get the currently set ring tone and play it, or check if the phone profile is set to Silent , and then Vibrate the phone and so on.

    And about playing wma files programmatically, I've not tried to play a wma file with PlaySound() or sndPlaySound(), have you tried this? Assuming it doesn't work, am guessing you will need to use the Windows Media Player Control, take a look at the following links,

    Using the Windows Media Player Control in a C++ program

    How to: Embed Windows Media Player on a Form



    • Marked as answer by famfy Sunday, April 25, 2010 10:56 AM
    Sunday, April 25, 2010 8:53 AM
  • I see. It seems that there no other way... I'll write such a function..

    I have tried to play wma file with both PlaySound() and sndPlaySound() but no sound appears...

    Thanks for recommendation about Media Player, I'll test it...


    Sunday, April 25, 2010 10:56 AM