473,791 Members | 2,853 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# Running a Windows Form App from a Windows Service

3 New Member
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:

ProcessStartInf o theProcess;
theProcess = new ProcessStartInf o("C:\\myFilePr ocess.exe");
theProcess.Argu ments = fileName;

For testing purposes I have myFileProcess.e xe code loaded down with Event Log writers. Using those I see that myFileProcess.e xe 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.e xe 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 5146
trinityofsouls
3 New Member
The code to call the Process is actually

ProcessStartInf o theProcess;
theProcess = new ProcessStartInf o("C:\\myFilePr ocess.exe");
theProcess.Argu ments = fileName;
Process.Start(t heProcess);

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
3687
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 , /webapps/sue) and i have added the folders bob, sue in my server.xml(in the context path). When i am trying to run jsp files from my browser, it works fine. But, the following jsp files reports some exceptions which is quite hard to understand. Here is...
8
2768
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 this would be simple enough if the ASP didn't have any user input, but it does.
7
1477
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 when I hit the start button the IDE just hangs. This just started happening recently (last few days). I'm not sure if it's something else I installed recently or copying Projects from my laptop to the Desktop and then editing/running them or...
3
1640
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 classes. The classes 'run' themselves using several threads and only stop when the form is closed. Now I've used these worker classes in the service application. When I try to run my service manually, I am given a message that the service stopped...
14
3708
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 program from running through the sub main code and then closing without ever firing the timer? I can put Do While 3 <> 2 Loop
4
4185
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 check to see if the status is in stopped or running mode. But that doesn't tell me if it is actually running. I need to know this so that if it happens I can programmatically start the same service on another machine.
3
2278
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 form before logoff. But I know that it run properly because when I log back in the form is there and works fine. So the form opened and run, but windows was already in the "logoff" screen with no desktop showing, so I missed the form. Is there any...
2
1477
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: System.InvalidOperationException An error occurred creating the form. See Exception.InnerException for details. The error is: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the...
3
2150
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 an Oracle database. This has been working fine for two years and it still is working fine in our production environment. But after installing a new test server the problems started. I did many tests but there is something strange. When I start the...
0
9669
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9515
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10154
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9993
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4109
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3713
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2913
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.