473,395 Members | 1,418 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,395 software developers and data experts.

C# Running a Windows Form App from a Windows Service

I am trying to run a windows application from a service.

Both the Windows Form App and the Windows Service were created using the .NET 2005 "New Project" Templates.

There service is working as intended (It picks up files to be proccessed out of watch directories) however there seems to be an issue when the Windows App is called.

I use the below to call the application:

ProcessStartInfo theProcess;
theProcess = new ProcessStartInfo("C:\\myFileProcess.exe");
theProcess.Arguments = fileName;

For testing purposes I have myFileProcess.exe code loaded down with Event Log writers. Using those I see that myFileProcess.exe is indeed called and the onload event is fired and executed in its entirety. However the form never shows. When I bring up the Task Manager I see that myFileProcess.exe is indeed running.

I believe this has something to do with the fact that Services do not show forms. But I figured seeings as I am kicking off a new process that it should work.

Does anyone know of a better way to kick off my process, or know of a way to make the form display?

When looking up information on this I found a number of references to "Setting Desktop Interaction on" but I have yet to figure out how to do this.

Thanks,
TrinityofSouls
Jul 2 '07 #1
1 4997
The code to call the Process is actually

ProcessStartInfo theProcess;
theProcess = new ProcessStartInfo("C:\\myFileProcess.exe");
theProcess.Arguments = fileName;
Process.Start(theProcess);

Forgot the 4th line on my post.
Jul 3 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Jagdeesh | last post by:
Hai Colleagues, I am using Tomcat 4.1.24 and JDK 1.4.0_03 in my winXP machine. I've transferred a set of folders(containing jsp files) into tomcat's webapps directory(to /webapps/bob ,...
8
by: Jonathan Heath | last post by:
Hi all, I have created an ASP script that enters data into an Access Database. My problem is that I'd like this script to run when the computer is shutdown or the user logs off. I think...
7
by: Michael C | last post by:
Hi all, Just started having a problem with the IDE. When I try to 'start' code in the IDE the IDE locks up. It builds and re-builds OK, and I can run the generated EXE outside the IDE, but...
3
by: Claire | last post by:
Sorry for such a daft question. Ive been following some tutorials on creating windows services. Ive not done them before. In my original debuggable windows form application, I create my worker...
14
by: William LaMartin | last post by:
If I have a Windows application with no form--only a module that starts with sub main and which has a system timer, in the elapsed event of which I want to run some code, how can I keep this...
4
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to...
3
by: =?Utf-8?B?Zmh1bnRlcg==?= | last post by:
I have a Windows Service that should pop a windows form right before logoff, for the user to enter some information. I got things working fairly well except that the user does not get to see the...
2
by: monishch | last post by:
Hi!, I am developing a windows service using vb.net in VB 2005.Through the service I am trying to run a exe.While starting service I am getting the following error: ...
3
by: Cor Pruim | last post by:
I have a very strange problem. I have written a Windows Service with VS2003 in vb.net. This service does some calculations and after that it needs to produce some Excel reports by getting data from...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.