473,395 Members | 1,972 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.

Starting program from Service in VB.net

guys..i am having a hard time with this one..

i have created a service which works fine..except when i want to
execute another program (notepad.exe)...i know how to execute itusing
PROCESS.start()

but the problem is ..i dont see it on the desktop..it is not
interacting with the desktop...i know how to change it in the admin
options but i need to know how to do it in the CODE...to have it run
the service and run notepad.exe on the desktop...or any other .exe
file.
please help
Nov 20 '05 #1
1 2070
> i have created a service which works fine..except when i want to
execute another program (notepad.exe)...i know how to execute itusing
PROCESS.start()


OK, this is a longshot, and off the top of my head, but if you are in
control of the code for both the service and the application that you want
to launch, you could write the application to get a reference to the running
service and pass it a reference to itself: (but I don't remember if VB.NET
still has GetObject)

Dim serviceObject As Whatever = GetObject("MyService.SomeClass")

serviceObject.AppToLaunch = Me

And then let the service not *launch the app*, but have the app launch
silently, and the service can do something like this:

Private _appToLaunch As Object

....

' in some code that decides to launch it
CType(_appToLaunch, SomeSpecificType).Visible = True

There are some other notes on why you experience this problem in my response
to the "Shell Problems" thread. I mentioned ASP.NET and COM+, but I think
it's fair to guess that services behave the same way.
--
Peace & happy computing,

Mike Labosh, MCSD
"SELECT * FROM Users WHERE Clue > 0"
Nov 20 '05 #2

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

Similar topics

1
by: Glenn | last post by:
I have used this code successfully in a form application. I tried to add the same code in a service and have not been able to get the application to start. I have the service starting with a local...
0
by: tshad | last post by:
I have a Windows Service I created that just sets a timer and writes to EventLog every 10 seconds. It installed fine and it actually starts. But it says it doesn't. The progress bar shows the...
2
by: Billy Cormic | last post by:
Hello, I have successfully created a windows service. I would now like the windows service to call another program and start it when the service starts. I have been unable to do this. For the...
6
by: Arnie | last post by:
We're using the ServiceController class provided by the .NET Framework, programming in C#. We are using the Start() method to start a service from another service. This works fine most of the...
5
by: Lamis | last post by:
Hi, i have just created my first Windows service and it is working great.. my problem is that I need to start an application in my service: protected override void OnStart(string args) {...
7
by: Peter S. | last post by:
I currently have created a C# program that automatically updates an SQL database once everyday. It's an application that I manually start. I want make it so that if the (Windows 2003) server...
2
by: Soren S. Jorgensen | last post by:
Hi, How do I see, from within my main method, in what context my assembly, containing my service program, is executed ?? I want to be able to detect if the assembly is executed by the service...
3
by: Cenarius | last post by:
Hi, I need some help, i don't know much about programming other than executing them get getting them from scripting sites. My program is it won't start a service if the startup type is Disabled. it...
16
by: sunil | last post by:
Hi, I have a service written in c# that I need to run as a "Network Service". I am using a setup project to install the service. If I install the service in User's Personal Folder, I get the...
7
by: Joseph Geretz | last post by:
I have a Service which runs OK, but I'm abviously not starting it properly. In my OnStart event I commence a long running process which polls a database table and performs various processing. Since...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
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...
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,...

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.