Click here to Skip to main content
15,867,997 members
Please Sign up or sign in to vote.
1.16/5 (4 votes)
See more:
Without going into too much confusing detail, I have a small question...

I'm developing a Winforms application. Because of the purpose of theapplication, it's desirable that windows doesn't play any system sounds (eg. "mail received" etc) while it is running.

I've done a solution where I manipulate the selected sound scheme setting in the Registry (setting it to "No Sounds" when the application starts and returning it to the selected sound scheme when it closes). That works great, no problem.

But manipulating the registry requires the application to be run with admin priviledges, and I would rather avoid that if possible at all.

Does anybody know of any other way of changing the current sound scheme programmatically? Any Api's or namespaces I might have missed.

Googling this turns up absolutely zilch!

[EDIT] To keep irrelevant comments to a minimum: I NEED to do this by changing the current sound scheme - not in any other way. What I need input on is HOW to change the selected sound scheme in the best way, nothing more, nothing less... As mentioned, I have got a working solution, but I would like to do it in a more elegant way (eg. without requiring admin permissions), hence this question [/EDIT]

TIA,
Johnny J.
Posted
Updated 25-May-15 3:45am
v5
Comments
Mehdi Gholam 25-May-15 9:27am    
How about turning the volume down.
Johnny J. 25-May-15 9:36am    
How about keeping irrelevant comments out of it?
Dave Kreskowiak 25-May-15 10:03am    
His comment is valid. The problem is you're trying to turn off a SYSTEM WIDE setting. That always requires admin priv's. There is no other way to "disable" the system sound scheme other than setting the scheme to "none".
Sergey Alexandrovich Kryukov 25-May-15 10:15am    
Dave, it looks like your valid comment has been edited, maybe just be mistake. Unfortunately, we face counter-productive and rude behavior here, I don't understand why.
—SA
Johnny J. 25-May-15 10:18am    
I've explained why below. I don't mean to be rude, but instead of trying to help, people are just wasting time...

I would never myself answer a question with something completely different that what the OP was asking, I don't understand the need to do so....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900