473,407 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Start a Windows app from a Window service

Hi,

is it possible to start a windows application from within a windows service?

I was thinking of having a windows service on a set of clients poll a
central machine for messages. If one arrives for a certain client I would
start up a windows application to notify the user.

Is this possible?
Aug 25 '07 #1
5 2374
"cashdeskmac" <ca*********@discussions.microsoft.comwrote in message
news:4B**********************************@microsof t.com...
is it possible to start a windows application from within a windows
service?
You can start the application with Process.Start(...). However, the
default configuration of the Windows Service will prevent the application
from interacting with the desktop, so this will not be very useful.
To give the Windows Service (and the application started from it) the
ability to interact with the Desktop, you can use the Services applet from
the Administrative Tools in Control Panel, edit the Properties of your
service, and select the checkbox "Allow Service to interact with desktop".
Be careful with the things that your program does, since it will be
running with elevated privileges (the service account) rather than the
account of the logged-in user.

Aug 25 '07 #2
cashdeskmac wrote:
Hi,

is it possible to start a windows application from within a windows service?

I was thinking of having a windows service on a set of clients poll a
central machine for messages. If one arrives for a certain client I would
start up a windows application to notify the user.

Is this possible?

Are you going to alert the "user" using other methods as well? If not,
what happens if the user isn't logged on such as on a server? I'd prefer
logging to the System event log and logging to possibly an application
log file and if I want to read the log I'll open the application myself
or look at Event viewer.

Brandon
Aug 26 '07 #3
Thanks, Alberto.

is it possible to assign a value to "Allow Service to interact with desktop"
during deployment, as part of the build process or directly in code?

"Alberto Poblacion" wrote:
"cashdeskmac" <ca*********@discussions.microsoft.comwrote in message
news:4B**********************************@microsof t.com...
is it possible to start a windows application from within a windows
service?

You can start the application with Process.Start(...). However, the
default configuration of the Windows Service will prevent the application
from interacting with the desktop, so this will not be very useful.
To give the Windows Service (and the application started from it) the
ability to interact with the Desktop, you can use the Services applet from
the Administrative Tools in Control Panel, edit the Properties of your
service, and select the checkbox "Allow Service to interact with desktop".
Be careful with the things that your program does, since it will be
running with elevated privileges (the service account) rather than the
account of the logged-in user.

Aug 26 '07 #4
"cashdeskmac" <ca*********@discussions.microsoft.comwrote in message
news:68**********************************@microsof t.com...
is it possible to assign a value to "Allow Service to interact with
desktop"
during deployment, as part of the build process or directly in code?
I have seen this question asked a few times in various forums, but never
saw an answer. As far as I know, you can't do it in the same way as you
configure the rest of the properties of the Service by means of the
ServiceInstaller and ServiceProcessInstaller. The only alternative that I
can think of is to modify directly the Windows Registry. Change an existing
service to "Allow Service to interact with desktop", explore the registry to
see what setting changed in that service, and then use some code to apply
during deployment the same chage to the registration of your service in the
Registry.

Aug 26 '07 #5
"cashdeskmac" <ca*********@discussions.microsoft.comwrote in message
news:68**********************************@microsof t.com...
Thanks, Alberto.

is it possible to assign a value to "Allow Service to interact with
desktop"
during deployment, as part of the build process or directly in code?

"Alberto Poblacion" wrote:
>"cashdeskmac" <ca*********@discussions.microsoft.comwrote in message
news:4B**********************************@microso ft.com...
is it possible to start a windows application from within a windows
service?

You can start the application with Process.Start(...). However, the
default configuration of the Windows Service will prevent the application
from interacting with the desktop, so this will not be very useful.
To give the Windows Service (and the application started from it) the
ability to interact with the Desktop, you can use the Services applet
from
the Administrative Tools in Control Panel, edit the Properties of your
service, and select the checkbox "Allow Service to interact with
desktop".
Be careful with the things that your program does, since it will be
running with elevated privileges (the service account) rather than the
account of the logged-in user.


Not without a registry hack, however you shouldn't NOT set the option, this
option was invented to allow for service debugging purposes when NT was
first released, but more importantly it's no longer supported on Vista.

Willy.

Aug 26 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: m00nm0nkey | last post by:
Hello. I am able to succesfully build and install my VB.Net Windows Service, using the Command Line InstallUtil #EXE PATH#. However, when I press start in MMC, to start the service, I get this...
4
by: Daniel Reber | last post by:
I am trying to start a process from a windows service but when the process starts the command window that the process runs in never shows. Is this because I am calling it from a windows service? ...
4
by: Dao | last post by:
I have created a windows service called MyService. I followed the MSDN sample code to add the following code but it did not work. What I tried was that to start another or external program when...
3
by: Chuck Bowling | last post by:
Ok, I'm not sure this is a C# question but here goes anyhow... I used this walkthru to create a windows service: ...
5
by: SiD` | last post by:
when starting a windows service writte in vb.net, a messagebox appears: cannot start service from the command line or a debugger. A windows service must first be installed using installutil.exe ...
6
by: Dde | last post by:
Hi, I am having a problem starting a process from within a web service. My code works in a console program but not from the web service. Looks like the process starts, I can see it in...
17
by: UJ | last post by:
Is there any way for a windows service to start a windows program ? I have a service that will need to restart a windows app if it needs to. TIA - Jeff.
6
by: uuyytt | last post by:
I have a Windows service from which I want to start Internet Explorer with a particular URL as an argument. I don't know why my code (shown below) doesn't work. I know that IExplore.exe starts as I...
3
by: illegal.prime | last post by:
Hi all, I have a service that needs to start a regular windows application. I'm running the service as ServiceAccount.LocalSystem. But, when it starts the process (using Process.Start) the GUI...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.