Solved

NT Service and MessageBeep()

Posted on 1998-11-11
1
366 Views
Last Modified: 2013-12-03
From an NT Service, is it possible to play one of the standard 'sounds' (configured in the control panel), and if so how?
I am trying to use MessageBeep(MB_OK), but all I get is a simple speaker beep, not the playing of the configured .wav file.
0
Comment
Question by:kfe
1 Comment
 
LVL 86

Accepted Solution

by:
jkr earned 100 total points
ID: 1415984
Yes, i think it is possible. Like a lot of NT service issues, the problem is that the service is running under teh 'SYSTEM' account, which usually has no sounds configured. The 2 ways to solve this:

1. Set the service to run under a specific account (control panel -> services)

2. Use 'LogonUser()' and 'ImpersonateLoggedOnUser()' to use a specific account and its settings from within the service.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question