Windows > Software Development for Windows Client Forums > Application Compatibility for Windows Development > Session 0 Help - Service running in session 0 required to play sounds! Possible?
Ask a questionAsk a question
 

General DiscussionSession 0 Help - Service running in session 0 required to play sounds! Possible?

  • Friday, October 16, 2009 5:54 AMAnanda Ganesh Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    The scenerio is such that I have a windows service running that is connected to hardware and evertime a person shows a tag it should beep.
    This was not a problem in Windows XP , however the 'beep' sound doesnt play in Windows Vista.

    Also I have a strange requirement that the end user should not be able to disable the service - hence I cannot run this as an interactive service as well.

    My 1st doubt is that can a service in session 0 play sounds as opposed to showing an UI? [Even if allow interaction's in enabled?]

    My 2nd doubt is that is there a way to remediate this issue when I want the service to run the service in session 0? I would prefer a quick fix instead a long workaround due to time constraints of the project.


    C# Fan! ananda84(at)gmail(dot)com

All Replies

  • Friday, October 16, 2009 11:06 PMSheng Jiang 蒋晟MVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Interactive service support is removed in Vista, so you should get ERROR_INVALID_FUNCTION when you call Beep. If you want to notify the user, notify in a program that runs on the user's desktop.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP
  • Friday, October 30, 2009 6:38 PMNathCorp Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    What happens if no user is logged on and the service still wants to play sound. There are quite a few scenario's around this. For example a service is monitoring a peripheral and if certain events happens it wants to raise attention/inform by playing a sound.

    http://www.NathCorp.Com
  • Friday, October 30, 2009 8:16 PMSheng Jiang 蒋晟MVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Then log on a user to hear it. You can also send email /SMS to someone in case they are not near enough.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP
  • Monday, November 02, 2009 10:47 PMNathCorp Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Yes - if having someone logged on always would have been an option - we would not have a problem. The customer in this scenario is looking for the sound to be played (based on events) even if no one is logged in.


    http://www.NathCorp.Com
  • Tuesday, November 03, 2009 3:04 AMSheng Jiang 蒋晟MVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Check if the device supports other interfaces like MCI, DirectSound or Direct Music. If non of those work, you can try writing your own virtual audio driver that has a back door to receive data from your service and redirect audio samples to the physical sound card.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP