Hey everyone,
I am hoping that this site will offer the expertise, and hopefully the assistance that other sites have been unable to give.
I asked the question that follows on STACKOVERFLOW (my local place for assistance) a week ago, with no luck, and today posted on the msdn dev forums which has also received no information....
I shall begin...
My Aim:
I intend to make a program, which has two (potentially more) components. The first is a Windows form, nice and clean with some options on for a user to choose. In the most basic example, a user can choose an executable and push a button. This choice is then saved 'somewhere' and passed to our second component, the windows service, which then checks if its running, and if it is, kill the process.
Currently I have the service working by itself, with a hardwired executable (calc.exe) and it runs smoothly, ending that ***** whenever it pops up. However my attempts to pass information from a windows form to the service have all failed.
I have tried various things such as:
or...
Neither work...
So I pose the question, is it possible? I thought it was, as an Antivirus/Firewall (take Nortons) has a front end GUI which passes stuff to the backend.
Btw this program will be installed with ADMIN Privileges.
Is there an alternative to what I am trying to do? Am I going about it wrong?
Here is the original link:
StackOverflow Question
Thanks everyone
I am hoping that this site will offer the expertise, and hopefully the assistance that other sites have been unable to give.
I asked the question that follows on STACKOVERFLOW (my local place for assistance) a week ago, with no luck, and today posted on the msdn dev forums which has also received no information....
I shall begin...
My Aim:
I intend to make a program, which has two (potentially more) components. The first is a Windows form, nice and clean with some options on for a user to choose. In the most basic example, a user can choose an executable and push a button. This choice is then saved 'somewhere' and passed to our second component, the windows service, which then checks if its running, and if it is, kill the process.
Currently I have the service working by itself, with a hardwired executable (calc.exe) and it runs smoothly, ending that ***** whenever it pops up. However my attempts to pass information from a windows form to the service have all failed.
I have tried various things such as:
Code:
string[] myArgs = new string[1] { textBox1.Text };
serviceController1.Start(myArgs);
or...
Code:
serviceController1.Pause();
serviceController1.Continue(MyArgs);
Neither work...
So I pose the question, is it possible? I thought it was, as an Antivirus/Firewall (take Nortons) has a front end GUI which passes stuff to the backend.
Btw this program will be installed with ADMIN Privileges.
Is there an alternative to what I am trying to do? Am I going about it wrong?
Here is the original link:
StackOverflow Question
Thanks everyone